javascript disappears

Eric Wong normalperson at
Wed Aug 18 03:14:10 EDT 2010

Jimmy Soho <jimmy.soho at> wrote:
> If I now peek in /proc/31761/environ then I notice these:
>   GEM_HOME=/srv/app/releases/20100818022900/vendor/bundler_gems
>   PATH=/srv/app/releases/20100818022900/vendor/bundler_gems/bin:[... etc.]
>   GEM_PATH=/srv/app/releases/20100818022900/vendor/bundler_gems
>   BUNDLE_GEMFILE=/srv/app/releases/20100818022900/Gemfile
> which are all pointing to the working directory I pruned. Hence the
> message about Gemfile not found I guess.
> Any suggestions how / when to update those environment variables with
> correct values?

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

> > Other folks here may have more experience with Capistrano+Unicorn,
> > maybe they have portable recipes they can share.
> Maybe it's more a gem and/or bundler thing?  Though it seems like a
> general issue to me that environment variables can have references to
> old working directories, which need to be updated if you restart
> Unicorn with USR2 all the time.  Is this something Unicorn could
> possibly take care off?

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'

But I think the best option is to use a shared directory for Bundler
since it should speed up deploys, too.  On the other hand, maybe Bundler
should be taught to respect symlink directories...

Eric Wong

More information about the mongrel-unicorn mailing list