部署 Unicorn 报 rackup file (master) not readable 哪位遇到过

lazybios · April 09, 2015 · Last by king1990_cool replied at April 09, 2015 · 3579 hits

通过unicorn master -E production -c config/unicorn.rb -D 启动 unicorn 的时候 遇到下面得错误

/usr/home/vps1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:659:in `parse_rackup_file': rackup file (master) not readable (ArgumentError)
    from /usr/home/vps1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:77:in `reload'
    from /usr/home/vps1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:68:in `initialize'
    from /usr/home/vps1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:100:in `new'
    from /usr/home/vps1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:100:in `initialize'
    from /usr/home/vps1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `new'
    from /usr/home/vps1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
    from /usr/home/vps1/.rbenv/versions/2.1.5/bin/unicorn:23:in `load'
    from /usr/home/vps1/.rbenv/versions/2.1.5/bin/unicorn:23:in `<main>'

部署方式 选择的是 nginx + unicorn 之前运转一直良好,直到被我 kill 掉以后就一直启不来,unicorn 的配置方式也是参考的 railscasts 上的,具体配置

working_directory "/usr/home/vps1/appname"
pid "/usr/home/vps1/appname/tmp/pids/unicorn.pid"
stderr_path "/usr/home/vps1/appname/log/unicorn.error.log"
stdout_path "/usr/home/vps1/appname/log/unicorn.log"

listen "/tmp/unicorn.appname.sock"
worker_processes 2
timeout 30

各位有谁遇到过类似部署问题,求线索啊~

补充

找到原因了,命令格式错了,应该是 unicorn -E production -c config/unicorn.rb -D ,删掉前面出现得master即可。我是直接从ps aux | grep unicorn的输出中粘过来的 ⊙﹏⊙b 汗,这里贴一下,希望帮到遇到同样错误的人

检查下上次重启到这次重启之间修改的代码。感觉像是代码的问题。

Unicorn 命令需要在 APP 目录下运行

#1 楼 @hging 应该不是代码问题 用 rails s -e production 可以起来

#2 楼 @yesmeck 没道理呀 以前直接在应用根目录执行没有问题的 这回是就直接 kill 掉再起就不行了~~

难道不是 bundle exec unicorn -E production -c config/unicorn.rb -D?

http://stackoverflow.com/questions/10763696/cannot-start-unicorn 看看你执行的目录是不是真的能够对应上 config/unicorn.rb的文件目录。

You need to Sign in before reply, if you don't have an account, please Sign up first.