gpt4 book ai didi

ruby-on-rails - 为什么我的 Upstart Unicorn Rails 服务器出现错误 "rackup file (config.ru) not readable"

转载 作者:太空宇宙 更新时间:2023-11-04 04:34:18 28 4
gpt4 key购买 nike

我有一个 Rails 应用程序,通过 Capistrano 部署到 Ubuntu 14.04 Amazon EC2 实例,然后通过标准“upstart”服务启动 Unicorn 服务器。

# Upstart Configuration

description "Outright Mental Shop Webservice"
author "Outright Mental Inc."

start on (net-device-up
and local-filesystems
and runlevel [2345])

stop on runlevel [016]

respawn

script
cd /home/sh0/app/current/api
exec su -s /bin/sh -c 'exec "$0" "$@"' sh0 -- unicorn -c config/unicorn.rb
end script

作为测试,我以用户 sh0 身份 ssh 进入该计算机,并运行上面的 upstart 配置文件的 script block 中的确切命令。我的 tail -f/home/sh0/app/shared/log/unicorn.stderr.log 看起来不错:

I, [2015-05-16T00:15:36.966576 #2803]  INFO -- : Refreshing Gem list
I, [2015-05-16T00:15:38.320758 #2803] INFO -- : unlinking existing socket=/home/sh0/app/shared/.unicorn.sock
I, [2015-05-16T00:15:38.321051 #2803] INFO -- : listening on addr=/home/sh0/app/shared/.unicorn.sock fd=10
I, [2015-05-16T00:15:38.321385 #2803] INFO -- : listening on addr=0.0.0.0:8080 fd=11
I, [2015-05-16T00:15:38.367685 #2808] INFO -- : worker=1 ready
I, [2015-05-16T00:15:38.369270 #2803] INFO -- : master process ready
I, [2015-05-16T00:15:38.372035 #2811] INFO -- : worker=2 ready
I, [2015-05-16T00:15:38.372576 #2806] INFO -- : worker=0 ready
I, [2015-05-16T00:15:38.375378 #2814] INFO -- : worker=3 ready

但是当我尝试 sudo service sh0 start 时,我的 sudo tail -f/var/log/upstart/sh0.log 看起来很糟糕:

/usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:657:in `parse_rackup_file': rackup file (config.ru) not readable (ArgumentError)
from /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:77:in `reload'
from /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:68:in `initialize'
from /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:100:in `new'
from /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:100:in `initialize'
from /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/bin/unicorn:126:in `new'
from /usr/local/lib/ruby/gems/2.0.0/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'
from /home/sh0/app/current/api/bin/unicorn:16:in `load'
from /home/sh0/app/current/api/bin/unicorn:16:in `<main>'

有什么建议吗?

最佳答案

答案:没有任何理由。

sudo reboot now

而且它成功了。任何关于原因的评论可能会受到 future 开发人员的赞赏。

关于ruby-on-rails - 为什么我的 Upstart Unicorn Rails 服务器出现错误 "rackup file (config.ru) not readable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30270527/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com