Capistrano的独角兽重启问题 [英] Unicorn restart issue with capistrano
问题描述
我们正在使用cap进行部署,并使用一个脚本将USR2发送到独角兽进程以进行重新加载,该脚本通常可以运行,但偶尔会失败。发生这种情况时,在独角兽日志中显示它正在寻找一个不再存在的旧发行目录中的Gemfile。
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 looking in the unicorn log reveals that it's looking for a Gemfile in an old release directory that no longer exists.
例外:
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:14:in `build': /var/www/railsapps/inventory/releases/20111128233407/Gemfile not found (Bundler::GemfileNotFound)
请注意,这不是当前版本,而是已删除的较旧版本。
To clarify that's not the current release but an older one that's since been removed.
当它起作用时,它似乎可以正常工作-即它确实拾取了新代码-因此,我认为它在某种程度上不适合指代旧版本。
When it works it does seem to work correctly - ie it does pickup the new code - so I don't think it's somehow stuck referring to the old release.
有什么想法吗?
推荐答案
您应该设置 BUNDLE_GEMFILE
环境变量,然后再启动服务器,将其指向 current / Gemfile
。
You should set the BUNDLE_GEMFILE
environment variable before you start the server, point it at current/Gemfile
.
这篇关于Capistrano的独角兽重启问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!