当我使用以下命令预编译资产时,我想在生产模式下运行我的应用程序
RAILS_ENV=production bundle exec rake assets:precompile
我收到以下错误:
MYPCC:/media/New Volume/Rails$ RAILS_ENV=production bundle exec rake assets:precompile
/home/.rvm/rubies/ruby-1.9.3-p448/bin/ruby /home/.rvm/gems/ruby-1.9.3-p448@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
cannot load such file -- uglifier
(in /media/New Volume/Rails/app/assets/javascripts/application.js)
/home/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
/home/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/home/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.1/lib/sprockets/bootstrap.rb:45:in `expand_js_compressor'
/home/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.1/lib/sprockets/bootstrap.rb:18:in `block in run'
/home/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.1/lib/sprockets/compressors.rb:14:in `call'
/home/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.1/lib/sprockets/compressors.rb:14:in `compressor'
/home/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.1/lib/sprockets/compressors.rb:18:in `compress'
/home/.rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.0.4/lib/sprockets/processing.rb:265:in `block in js_compressor='
/home/.rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.0.4/lib/sprockets/processor.rb:29:in `call'
/home/.rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.0.4/lib/sprockets/processor.rb:29:in `evaluate'
/home/.rvm/gems/ruby-1.9.3-p448/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/home/.rvm/gems/ruby-1.9.3-p448/gems/sprockets-2.0.4/lib/sprockets/context.rb:175:in `block in evaluate'
我的 Gemfile 包含:
group :assets do
gem 'therubyracer'
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
跑
bundle install
请建议..