rails 3.0.11 with .sass files, polling for changes and default sass and css file locations

74 views
Skip to first unread message

CrazyCarl

unread,
Apr 23, 2012, 1:09:00 PM4/23/12
to Compass
$ rvm use ruby-1.9.2-p290
$ rails new bg_web --database=postgresql

# Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.11'
gem 'pg'
gem 'haml'
gem 'sass'
gem 'compass', '0.11.7'
gem 'heroku'


$ cd bg_web/ # enable .rvmrc file
$ bundle install
$ rails generate controller Pages home about contact

... This is where I'm at now ...
I'd like:
1) sass format
2) sass files in /app/stylesheets
3) css compiled to /public/stylesheets
4) automatic polling

CrazyCarl

unread,
Apr 23, 2012, 1:15:19 PM4/23/12
to Compass
http://compass-style.org/install/ says to do this:

$ cd <myproject>
> Edit Gemfile and add this:
group :assets do
gem 'compass-rails'
# Add any compass extensions here
end
$ bundle
$ bundle exec compass init rails --using blueprint --syntax sass

however I'm not using the asset pipeline, nor railties

Chris Eppstein

unread,
Apr 23, 2012, 1:16:42 PM4/23/12
to compas...@googlegroups.com
More in-depth install notes for rails can be found here: https://github.com/compass/compass-rails

chris


--
You received this message because you are subscribed to the Google Groups "Compass" group.
To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.


CrazyCarl

unread,
Apr 23, 2012, 1:27:11 PM4/23/12
to Compass
#/Gemfile
gem 'compass-rails' # without group :assets bc this isnt running w the
assets

$ bundle exec compass init --using blueprint --syntax sass #write just
fine
$ compass watch sass/ # this sass/ dir has .sass files in it
>> Nothing to compile. If you're trying to start a new project, you have left off the directory argument.



Chris Eppstein

unread,
Apr 23, 2012, 1:29:20 PM4/23/12
to compas...@googlegroups.com
Please follow the instructions. The assets group is required and you should always use bundler to exec compass with your app.

chris

CrazyCarl

unread,
Apr 23, 2012, 2:47:14 PM4/23/12
to Compass
alright this time in order:


$ rails new edge_bg --database=postgresql

#/Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.11'
gem 'pg'
gem 'haml'
gem 'sass'
gem 'haml-rails' # allows generators to write .haml files
group :assets do
gem 'compass-rails'
end

$ bundle
$ bundle exec compass init rails --using blueprint --syntax sass
$ rails generate controller Pages home about contact

#/config/application.rb:
Bundler.require(:default, :assets, Rails.env) if defined?(Bundler)

$ rails s #browse to localhost:3000/pages/about

#/app/views/layouts/application.html.haml
= stylesheet_link_tag 'screen'

# Above link throws:
# => Routing Error: No route matches "/stylesheets/screen.css"

CrazyCarl

unread,
Apr 23, 2012, 2:56:13 PM4/23/12
to Compass
solved

#/Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.11'
gem 'pg'
gem 'haml'
gem 'sass'
group :assets do
gem 'haml-rails' # allows generators to write .haml files
  gem 'compass-rails'
end

CrazyCarl

unread,
Apr 23, 2012, 3:13:25 PM4/23/12
to Compass
Now reloading the webpage doesnt trigger a check / refresh of the
edited stylesheets

As described here:

Developing with Rails-based Compilation
By default, your sass files in app/assets/stylesheets will be
automatically compiled by the the Sass::Plugin or the Rails asset
pipeline depending on the version of rails that you use.
When using this approach you will need to reload your webpage in order
to trigger a recompile of your stylesheets.
Reply all
Reply to author
Forward
0 new messages