Unicorn restart issue with capistrano

前端 未结 2 518
攒了一身酷
攒了一身酷 2021-02-02 17:01

We\'re deploying with cap and using a script that send USR2 to the unicorn process to reload and it usually works but every once in a while it will fail. When that happens looki

相关标签:
2条回答
  • 2021-02-02 17:39

    You should set the BUNDLE_GEMFILE environment variable before you start the server, point it at current/Gemfile.

    0 讨论(0)
  • 2021-02-02 17:39

    In your unicorn.rb add the before_exec block

    current_path = "/var/www/html/my project/current"
    
    before_exec do |server|
      ENV['BUNDLE_GEMFILE'] = "#{current_path}/Gemfile"
    end
    

    Read more about it here http://blog.willj.net/2011/08/02/fixing-the-gemfile-not-found-bundlergemfilenotfound-error/

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