2

次のコマンドを使用してアセットをプリコンパイルするときに、アプリケーションを本番モードで実行したい

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

提案してください..

4

1 に答える 1