javascript disappears

Jimmy Soho jimmy.soho at
Wed Aug 18 09:20:49 EDT 2010

> Aha!  I believe there's an option for Bundler to use the /srv/app/shared
> directory with Capistrano.  That's probably your best option.

I am using the shared bundler gems option, I use the example floating
around the internets:

run("cd #{release_path} && bundle install vendor/bundler_gems
--without development test --disable-shared-gems")

> You can also try force the environment variables with the
> before_exec hook in your config file:
>  before_exec do |server|
>    ENV['GEM_HOME'] = '/srv/app/current/vendor/bundler_gems'
>  end

After a few hours hacking I've come to the conclusion that's the only
way it can work, for now.

Having delved into bundler I think Bundler.setup needs to change. I'll
file an issue for that with them.

PS. I: for those interested, this is now the unicorn-conf.rb file I'm
using, so I can now happily prune all old releases:

PS. II: While I trying out various things I found that if I modified
the before_exec hook, then deployed that code, send USR2, then it
executes the before_exec hook of the old master, not the new master.
So I then had to send a USR2 a second time to see the new code in
before_exec taking effect. Is that intentional behaviour?

PS. III: Haven't tested it yet, but in case a USR2 fails, and unicorn
reverts back to the old master, does the old master then have the new
environment variable values? Or does it run the before_exec hook again
for the old master?


More information about the mongrel-unicorn mailing list