unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: javascript disappears
Date: Wed, 18 Aug 2010 00:14:10 -0700	[thread overview]
Message-ID: <20100818071410.GB29950@dcvr.yhbt.net> (raw)
In-Reply-To: <AANLkTikvpbqX9UZjM1tMbZYNqBZGHZGUL9P-JDak49of@mail.gmail.com>

Jimmy Soho <jimmy.soho@gmail.com> 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
Unicorn mailing list - mongrel-unicorn@rubyforge.org
Do not quote signatures (like this one) or top post when replying

  reply	other threads:[~2010-08-18  7:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17 23:38 javascript disappears Jimmy Soho
2010-08-18  0:02 ` Jimmy Soho
2010-08-18  1:14 ` Eric Wong
2010-08-18  2:23   ` Jimmy Soho
2010-08-18  2:45     ` Eric Wong
2010-08-18  3:39       ` Jimmy Soho
2010-08-18  7:14         ` Eric Wong [this message]
2010-08-18 13:20           ` Jimmy Soho
2010-08-18 23:34             ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100818071410.GB29950@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).