I found this answer somewhere else, can t remember exactly, but put this in config/initializers/sass.rb
:
Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths|
load_paths << "#{Rails.root}/app/assets/stylesheets"
load_paths << "#{Gem.loaded_specs[ compass ].full_gem_path}/frameworks/compass/stylesheets"
end
I also prefer SASS syntax (to SCSS). All you have to do is name files mystylesheet.css.sass
instead and it just works. You can even rename your application.css
to application.css.sass
, change the comments at the top to //
instead of /* */
and use the require_*
directives—it all works, and then you can use SASS in your application global stylesheet. It won t if you use compass in app/stylesheets
.
Don t require the Sass::Plugin
, it s totally separate to the new Rails asset engine which is based on Sprockets. It already knows how to compile SASS for you and manages the bundling of assets properly.
I imagine a new Compass release will do this automatically for Rails 3.1+ projects using the asset pipeline.