I’m upgrading an app from Rails 3.0 to 3.1. We’ve been using Compass and scss.
I’m getting an error when I do both of the following:
- Use a
sass-railshelper, likeimage-path - Use
config.sass.load_pathsinapplication.rbto tell it where to find things like Blueprint.
For example:
config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/blueprint/stylesheets"
The error that I get is like:
undefined local variable or method `config' for #<Sass::Script::Functions::EvaluationContext::0x00000105102998>
I have this in my Gemfile:
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
gem 'compass', '0.11.5'
end
… which is exactly what is generated by Rails 3.1.1.
What’s wrong here?
Looks like this is solved by using Compass 0.12. I updated my Gemfile to use this:
This also makes the
config.sass.load_pathsdirectives unnecessary.