0

将我的应用程序从 rails 3.2 升级到 rails 4 后出现以下错误

/xxx/activesupport-4.0.0/lib/active_support/core_ext/module/aliasing.rb:32:
in `alias_method': undefined method `join_asset_file_contents' for
module `ActionView::Helpers::AssetTagHelper' (NameError)

from /xxx/activesupport-4.0.0/lib/active_support/core_ext/module/aliasing.rb:32:
in `alias_method_chain'

我该如何解决这个问题?

我的宝石文件

source 'http://rubygems.org'

gem 'rails', '4.0.0'
gem 'geocoder'
gem 'dalli'
gem "rmagick",:platforms=>:ruby
gem "rscribd"
gem "rubyzip", "0.9.9", :require => 'zip/zip'
gem "roo", "1.12.2"
gem "nokogiri", "1.6.0"
gem "spreadsheet"
gem "google-spreadsheet-ruby"
gem "mysql2", "0.3.13" ,:platforms=>:ruby
gem "delocalize"
gem 'rake', '10.1.0'
gem 'smurf'
gem 'json'
gem 'httparty' 
gem 'remotipart', '1.2.1'
gem "delayed_job"
gem "nested_form","0.3.2"
4

1 回答 1

0

蓝精灵宝石并不是真正的 rails 4 友好。您可以设置自己的压缩器,config/environments/production.rb并确保您没有使用 rails 3 compress = true 设置。

# config.assets.compress = true --- commenting this out because it's deprecated.
config.assets.js_compressor  = :uglifier  
config.assets.css_compressor = :sass

Uglifier 和 sass 是您需要添加回 gemfile 的 gem:

gem 'sass-rails'
gem 'uglifier'
于 2013-10-15T12:27:10.437 回答