[RFC/PATCH] Bundler/Sandbox documentation updates

Eric Wong normalperson at yhbt.net
Thu Mar 10 16:29:03 EST 2011

Lawrence Pit <lawrence.pit at gmail.com> wrote:
> Eric Wong <normalperson at yhbt.net> wrote:
>> I've tried this a few times, and everytime I get something like this:
>>> https://gist.github.com/331b0decab62fd58483c
>> Yikes, it looks like the UNICORN_FD env is getting clobbered somehow.
>> Not sure what could be causing that.
>>> If I revert back to setting the GEM_HOME, GEM_PATH and PATH in the
>>> before_exec it works fine.

> >  Which Bundler version is this with?
> Bundler 1.0.10

Odd, I actually used this in my Rainbows! config file to switch an
Isolate deploy to Bundler (1.0.10) yesterday.   Everything for Rainbows!
applies to Unicorn, too).

  # switching from Isolate to Bundler:
  if ENV["GEM_HOME"] =~ %r{/isolate/}
    ENV.delete "GEM_HOME"
    ENV.delete "GEM_PATH"
    # don't need anything else in $PATH for a web server
    ENV["PATH"] = "/home/ew/ruby-1.9.2/bin"

    # START_CTX is considered a stable interface in Unicorn
    start_ctx = Unicorn::HttpServer::START_CTX
    start_ctx[0] = "bundle"

    # it's even possible to use USR2 to switch between Unicorn and
    # Rainbows! without any downtime :)
    start_ctx[:argv] = %w(exec rainbows).concat(start_ctx[:argv])

Eric Wong

More information about the mongrel-unicorn mailing list