新手问题 服务器配置 Rails 程序的错误 求解

TCnet · 2017年05月17日 · 最后由 awking 回复于 2017年05月17日 · 2661 次阅读

这个是日志最后几十行。 访问网址 提示拒绝访问。

bundler: failed to load command: unicorn (/home/deploy/apps/zebra_production/shared/bundle/ruby/2.3.0/bin/unicorn)
ArgumentError: Already running on PID:4327 (or pid=/home/deploy/apps/zebra_production/current/tmp/pids/unicorn.pid is stale)
  /home/deploy/apps/zebra_production/shared/bundle/ruby/2.3.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:206:in `pid='
  /home/deploy/apps/zebra_production/shared/bundle/ruby/2.3.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:135:in `start'
  /home/deploy/apps/zebra_production/shared/bundle/ruby/2.3.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
  /home/deploy/apps/zebra_production/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
  /home/deploy/apps/zebra_production/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `<top (required)>'
I, [2017-05-17T01:47:54.005704 #4383]  INFO -- : executing ["/home/deploy/apps/zebra_production/shared/bundle/ruby/2.3.0/bin/unicorn", "-D", "-c", "/home/deploy/apps/zebra_production/shared/config/unicorn.rb", "-E", "production", {12=>#<Kgio::UNIXServer:/tmp/unicorn.zebra_production.sock>}] (in /home/deploy/apps/zebra_production/releases/20170516134056)
I, [2017-05-17T01:47:54.347907 #4383]  INFO -- : inherited addr=/tmp/unicorn.zebra_production.sock fd=12
I, [2017-05-17T01:47:54.348308 #4383]  INFO -- : Refreshing Gem list
We've got an old pid and server pid is not the old pid
killing master process (good thing tm)
We've got an old pid and server pid is not the old pid
killing master process (good thing tm)
We've got an old pid and server pid is not the old pid
I, [2017-05-17T01:47:56.846945 #4388]  INFO -- : worker=0 ready
killing master process (good thing tm)
We've got an old pid and server pid is not the old pid
killing master process (good thing tm)
We've got an old pid and server pid is not the old pid
killing master process (good thing tm)
I, [2017-05-17T01:47:56.881755 #4392]  INFO -- : worker=1 ready
I, [2017-05-17T01:47:56.886841 #4396]  INFO -- : worker=2 ready
I, [2017-05-17T01:47:56.889503 #4383]  INFO -- : master process ready
I, [2017-05-17T01:47:56.916412 #4400]  INFO -- : worker=3 ready
I, [2017-05-17T01:47:56.926179 #4404]  INFO -- : worker=4 ready
I, [2017-05-17T01:47:57.606026 #4327]  INFO -- : reaped #<Process::Status: pid 4331 exit 0> worker=0
I, [2017-05-17T01:47:57.606243 #4327]  INFO -- : reaped #<Process::Status: pid 4333 exit 0> worker=1
I, [2017-05-17T01:47:57.606299 #4327]  INFO -- : reaped #<Process::Status: pid 4337 exit 0> worker=2
I, [2017-05-17T01:47:57.606349 #4327]  INFO -- : reaped #<Process::Status: pid 4341 exit 0> worker=3
I, [2017-05-17T01:47:57.606396 #4327]  INFO -- : reaped #<Process::Status: pid 4345 exit 0> worker=4
I, [2017-05-17T01:47:57.606442 #4327]  INFO -- : master complete

提示说

We've got an old pid and server pid is not the old pid
killing master process (good thing tm)

你先找到原有的 unicorn 进程,杀掉他。再重新启动 unicorn。

ps aux | grep unicorn

kill -9  端口号

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