sosedoff/capistrano-unicorn — pull request #4 by mcrowe (2012-01-19 05:15:03+00:00)
Title: Specify BUNDLE_GEMFILE in reload task

An earlier patch adds a partial fix to a problem with Unicorn not properly updating it's gem list when receiving the USR2 signal. The problem was that the new Gemfile is not read by Unicorn. One fix for this is to specify the Gemfile explicitly in the startup command for Unicorn using BUNDLE_GEMFILE, and using a symbolically linked path so that it will still find the right Gemfile after a deploy.

This problem is discussed a little here: http://davidvollbracht.com/blog/headachenewunicorn-capistrano-bundler-usr2 , and here: http://unicorn.bogomips.org/Sandbox.html .

The earlier patch adds this fix to the start task. However, this still leaves issues if the reload task is called while Unicorn is not running. This starts the server with a separate command that didn't specify the BUNDLE_GEMFILE, so that later reloads may not properly update gems. This patch fixes that bug.

Great gem, by the way!