我正在将应用程序从Rails 3.0升级到3.1。我们一直在使用Compass和scss。
当我 以下
时,我收到了错误:sass-rails
帮助,例如image-path
config.sass.load_paths
中的application.rb
告诉它在哪里可以找到蓝图等内容。例如:
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"
我得到的错误就像:
undefined local variable or method `config' for #<Sass::Script::Functions::EvaluationContext::0x00000105102998>
我在我的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
......这正是Rails 3.1.1生成的内容。
这里有什么问题?
答案 0 :(得分:2)
看起来这是通过使用Compass 0.12解决的。我更新了我的Gemfile以使用它:
gem 'compass', '0.12.alpha.1'
这也使config.sass.load_paths
指令变得不必要。