Rails3 and Sass :: Plugin :: options

When I try to add Sass::Plugin.options[:style] = :compact to environment.rb

When I try to start my server, I get:

uninitialized constant Sass (NameError)

I added the gem 'haml', '3.0.0' to my Gemfile.

Has anyone come across this?

+5
plugins ruby-on-rails sass ruby-on-rails-3 nameerror
source share
2 answers

I tried what you described and it worked for me. I am using haml 3.0.4, which is the latest version. You can run gem update haml on your system and try again. The list of changes from 3.0.0 to 3.0.4 is located at http://sass-lang.com/docs/yardoc/file.SASS_CHANGELOG.html

I also suggest not putting this in your environment.rb file, but instead create a config/initializers/sass_config.rb and put the SASS configuration there. My looks like this:

 Sass::Plugin.options[:property_syntax] = :old Sass::Plugin.remove_template_location("./public/stylesheets/sass") Sass::Plugin.add_template_location("./app/stylesheets") 
+6
source share

I had the same problem, and using the sass_config.rb file it worked for my case - it seems that calls in the .rb environment occur before the init.rb plugin is loaded.

+2
source share

All Articles