Search code examples
herokurakeruby-on-rails-3.1sass

undefined method `sass' for #<Rails::Application::Configuration on Heroku


I've looked around a bit and didn't find similar errors reported. I don't recall having modified my production.rb. And for good measure, here's my application.rb

Here's the stack trace from Heroku.

$ heroku run rake db:migrate --remote staging --trace

Running rake db:migrate --trace attached to terminal... up, run.2
/app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53:      warning: already initialized constant WFKV_
rake aborted!

undefined method `sass' for #<Rails::Application::Configuration:0x000000047c6fb0>
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/railtie/configuration.rb:78:in `method_missing'
/app/config/application.rb:63:in `<class:Application>'
/app/config/application.rb:18:in `<module:Instantice>'
/app/config/application.rb:17:in `<top (required)>'
/app/Rakefile:5:in `require'
/app/Rakefile:5:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:78:in `block in load_rakefile'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:61:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>'

I initially thought this line in the application.rb could be causing this (although it never had before).

config.sass.preferred_syntax = :sass

Removing it was fruitless though.


Solution

  • I had the same error...

    I just needed to move the gem 'sass-rails' out of the assets group

    Was

    #Gemfile
    group :assets do
       gem 'sass-rails'  # Was giving me errors here.
       ...
    end
    

    Is

    #Gemfile
    gem 'sass-rails'    # No more errors
    group :assets do
       ...
    end