I am trying to get Compass working on my dev machine and on an Heroku stack.
The steps I followed are :
- I installed the Compass gem via the Gemfile
-
I ran the command that initializes the compass project inside my 3.1 rails app
compass init rails . –using blueprint
I got these lines:
directory ./app/stylesheets/
directory ./app/stylesheets/partials/
create ./app/stylesheets/screen.scss
create ./app/stylesheets/partials/_base.scss
create ./app/stylesheets/print.scss
create ./app/stylesheets/ie.scss
This is a bit suspicious: these files should be generated in the app/assets/stylesheets folder, right?
I added these 3 lines to my application.html.erb file:
<%= stylesheet_link_tag 'screen.css', :media => 'screen, projection' %>
<%= stylesheet_link_tag 'print.css', :media => 'print' %>
<!--[if lt IE 8]><%= stylesheet_link_tag 'ie.css', :media => 'screen, projection' %><![endif]-->
When I launched compass watch, this is what I got from the terminal:
>>> Change detected to: ie.scss
create public/stylesheets/ie.css
create public/stylesheets/print.css
create public/stylesheets/screen.css
>>> Compass is watching for changes. Press Ctrl-C to Stop.
I followed the steps described on the compass website and the tutorial displayed after I initialized the project.
When I go on my app, the screen.css and the print.css are not loaded because their URL is /assets/screen.css.
Anybody had this problem?
Thanks.
The author of compass posted a fix for rails 3.1 integration with compass – https://gist.github.com/1184843
There is also a different way to make it work – http://spin.atomicobject.com/2011/07/12/sass-sprockets-compass-with-rails-3-1/