2013-03-08 174 views
2

上運行我的Linux服務器之一...的Rails:資產預編譯失敗

bundle exec rake assets:precompile RAILS_ENV=production --trace 

,我發現了以下錯誤......

** Invoke assets:precompile (first_time) 
** Execute assets:precompile 
/usr/local/bin/ruby /srv/www/example.com/shared/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace 
** Invoke assets:precompile:all (first_time) 
** Execute assets:precompile:all 
** Invoke assets:precompile:primary (first_time) 
** Invoke assets:environment (first_time) 
** Execute assets:environment 
** Invoke environment (first_time) 
** Execute environment 
** Invoke tmp:cache:clear (first_time) 
** Execute tmp:cache:clear 
** Execute assets:precompile:primary 
rake aborted! 
Command failed with status(): [/usr/local/bin/ruby /srv/www/example.com/s...] 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/file_utils.rb:53:in `block in create_shell_runner' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/file_utils.rb:45:in `call' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/file_utils.rb:45:in `sh' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/file_utils_ext.rb:40:in `sh' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/file_utils.rb:80:in `ruby' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/file_utils_ext.rb:40:in `ruby' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:12:in `ruby_rake_task' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in `call' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in `each' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain' 
/usr/local/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `each' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/bin/rake:23:in `load' 
/srv/www/example.com/shared/bundle/ruby/1.9.1/bin/rake:23:in `<main>' 

我使用Rails 3.2 .11,嘗試通過rake代碼挖掘,但我不是耙專家。任何人都會遇到這個問題不確定如何調試?謝謝。

+0

執行命令時,你確定你在正確的項目文件夾嗎? – fmendez 2013-03-08 18:48:01

+0

是的,否則它會說無法找到gemfile。 – HelloWorld 2013-03-08 18:49:40

+0

抱歉讓所有www/example.com都感到困惑,但那就是你的寶石所在。你可以嘗試在你的'config/application.rb'上添加'config.assets.initialize_on_precompile = false'(假設你沒有)並且再次運行該命令? – fmendez 2013-03-08 18:58:49

回答

0

當RAM很短並且進程使用太多的RAM時,內核會主動殺死進程。我把我的服務器切換到開發模式(從它的測試服務器開始)以跳過資產預編譯部分及其功能。

+0

你在使用什麼操作系統? – David 2013-03-23 22:04:06