从Rails 2升级到Rails 3后,资产预编译不起作用

时间:2013-11-16 14:25:20

标签: ruby ruby-on-rails-3 ruby-on-rails-3.2 compass-sass

从Rails 2升级到Rails 3后,运行RAILS_ENV=production bundle exec rake assets:precompile时出现以下错误:

rake aborted!
Undefined mixin 'linear-gradient'.

配置/ application.rb中:

config.assets.enabled = true

配置/环境/ production.rb:

config.assets.compress = true
config.assets.compile = true
config.assets.digest = true

的Gemfile:

group :assets do
gem 'sass-rails',   '~> 3.2.3'
gem 'uglifier', '>= 1.0.3'
end
gem "compass-rails"

配置/ compass.rb:

project_type = :rails
project_path = Compass::AppIntegration::Rails.root
http_path = "/"
css_dir = "public"
sass_dir = "app/assets/stylesheets"
environment = Compass::AppIntegration::Rails.env

当我尝试使用bundle exec compass compile编译资产时,它运行时没有任何错误。有没有人有想法?

1 个答案:

答案 0 :(得分:0)

您可能需要将以下行添加到application.rb

config.assets.precompile << /(^[^_]|\/[^_])[^\/]*$/