Unicorn stuck in loop: Refreshing Gem list

前端 未结 2 1756
臣服心动
臣服心动 2021-01-14 02:58

I\'m using Rails 4.0.0, Ruby 2.3 and Unicorn.

My app was working perfectly until the day I tried to add a nem gem in my Gemfile. Everything\'s working like a charm l

相关标签:
2条回答
  • 2021-01-14 03:11

    Similar problem here. It happens when you change you Gemfile, using unicorn:reload doesn't run your new code.

    Solved restarting unicorn instead of reloading it.

    If you are using Capistrano, change the after deploy trigger from invoke 'unicorn:reload' to:

    invoke 'unicorn:stop'
    invoke 'unicorn:start'
    

    According to https://github.com/tablexi/capistrano3-unicorn/issues/45 unicorn:restart is not working properly.

    0 讨论(0)
  • 2021-01-14 03:11

    Our problem was that unicorn master process wasn't restarted correctly, because it was killed with:

    /bin/kill -s HUP `cat tmp/pids/unicorn.pid`
    

    Which doesn't actually kill the unicorn master process (only reloads the config, see SIGHUP documentation). Verify by running ps -ef | grep 'unicorn'.

    Our problem was solved changing the killing of unicorn master process with:

    /bin/kill `cat tmp/pids/unicorn.pid`
    

    PS: cat tmp/pids/unicorn.pid just outputs the PID of the unicorn master process.

    0 讨论(0)
提交回复
热议问题