本文介绍了无法启动独角兽.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 unicorn 启动我的应用程序,但无法启动.我有一个参数错误 parse_rackup_file: rackup file (config.ru) not readable (ArgumentError)
I'm trying to start my app with unicorn, but cannot start.I've got an argument error parse_rackup_file: rackup file (config.ru) not readable (ArgumentError)
我的环境是rbenv ruby1.9.3和rails 3.1.3.
My environment is rbenv ruby1.9.3 and rails 3.1.3.
怎么了?
Mac-mini:rails_app Macmini$ cap deploy:start
* executing `deploy:start'
* executing "cd /home/deployer/public_html/rails_app/current/; bundle exec unicorn -c /home/deployer/public_html/rails_app/current/config/unicorn.rb -E production -D"
servers: ["211.125.67.15"]
[211.125.67.15] executing command
*** [err :: 211.125.67.15] /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/configurator.rb:610:in `parse_rackup_file': rackup file (config.ru) not readable (ArgumentError)
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/configurator.rb:76:in `reload'
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/configurator.rb:67:in `initialize'
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:104:in `new'
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:104:in `initialize'
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/bin/unicorn:121:in `new'
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/bin/unicorn:121:in `<top (required)>'
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
*** [err :: 211.125.67.15] from /home/deployer/public_html/rails_app/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'
*** [err :: 211.125.67.15] master failed to start, check stderr log for details
command finished in 1021ms
failed: "env RBENV_ROOT=/usr/local/rbenv PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH sh -c 'cd /home/deployer/public_html/rails_app/current/; bundle exec unicorn -c /home/deployer/public_html/rails_app/current/config/unicorn.rb -E production -D'" on 211.125.67.15
Mac-mini:rails_app Macmini$
推荐答案
我通过添加解决了这个问题
I resolved this issue by adding
working_directory("/path/to/rails_root")
里面 config/unicorn.rb
您可以参考此处的文档:http://unicorn.bogomips.org/Unicorn/Configurator.html#method-i-working_directory
You can refer to the documentation here:http://unicorn.bogomips.org/Unicorn/Configurator.html#method-i-working_directory
这篇关于无法启动独角兽.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!