Rails 预编译报错

a167651202 · 2013年07月08日 · 最后由 a167651202 回复于 2013年07月08日 · 3325 次阅读

请教各位,部署到服务器以后我预编译 assets RAILS_ENV=production rake assets:precompile 报错:

/home/deploy/.rvm/rubies/ruby-1.9.3-p429/bin/ruby /home/deploy/.rvm/gems/ruby-1.9.3-p429/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Command failed with status (): [/home/deploy/.rvm/rubies/ruby-1.9.3-p429/b...]
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

求各位指点一下,谢谢各位

你用下--trace 看看是在哪步挂的。

#1 楼 @jjzxcc

[email protected]:~/sites/lastbtc$ RAILS_ENV=production rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/deploy/.rvm/rubies/ruby-1.9.3-p429/bin/ruby /home/deploy/.rvm/gems/ruby-1.9.3-p429/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!
rake aborted!
Command failed with status (): [/home/deploy/.rvm/rubies/ruby-1.9.3-p429/b...]
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/file_utils.rb:55:in `block in create_shell_runner'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in `call'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in `sh'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:in `sh'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/file_utils.rb:82:in `ruby'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:in `ruby'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/home/deploy/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/bin/rake:19:in `load'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/bin/rake:19:in `<main>'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval'
/home/deploy/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile

--trace 以后的结果,您受累帮忙看一下

#3 楼 @jjzxcc 这个看了,英语水平有限,,没看懂,,额。。

@a167651202 上面说有可能是你服务器的内存不够。

@a167651202 还有可能就是你把 gem 'bootstrap' 加到了 group :assets 里。这种情况的话把 gem‘bootstrap' 移除就行。

VPS 1G 是标配

#5 楼 @jjzxcc 谢了。。内存不够了。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号