undefined method `options' for Sass::Plugin:Module #69

tallica opened this Issue Apr 25, 2011 · 2 comments


None yet

4 participants


Steps to reproduce:
1. Create a new rails application:
$ rails new testsass && cd testsass
2. Add haml and sass to Gemfile
gem 'haml'
gem 'sass'
3. Run bundle
4. Edit ./config/environments/development.rb and add Sass::Plugin.options[:style] = :expanded.
5. Run rails server:
$ rails s
6. You should see an error:
undefined method `options' for Sass::Plugin:Module

Ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
Rails 3.0.7
Haml 3.1.1
Sass 3.1.0

@nex3 nex3 added a commit that closed this issue Apr 26, 2011
@nex3 nex3 Use the proper hook for loading plugin.
Closes gh-69
Closes gh-67
@nex3 nex3 closed this in 53fcbaa Apr 26, 2011

I am getting this error now:

undefined method `options' for Sass::Plugin:Module (NoMethodError)

In my Gemfile:

gem 'rails', '3.1.1'
gem 'haml', '3.1.3'
gem 'sass', '3.1.10'

In my application.rb:

    require 'sass' # Without requiring 'sass' here it was crapping out even earlier
    Sass::Plugin.options[:template_location] = File.join(Rails.root, 'app/scss')
    Sass::Plugin.options[:css_location] = File.join(Rails.root, 'public/stylesheets/generated')

So I looked at the commit above and changed my application.rb to this:

    require 'sass'
    require 'sass/plugin'
    Sass::Plugin.options[:template_location] = File.join(Rails.root, 'app/scss')
    Sass::Plugin.options[:css_location] = File.join(Rails.root, 'public/stylesheets/generated')

And now it works. So did this stop working with Rails 3.1.1?

NOTE: I could not get sass-rails to work either because it apparently requires you to use the asset pipeline, which I am not yet upgrading to - one thing at a time...


Thank you for your help Peter, I could not figure out how to fix this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment