Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Clear Bundler settings in ENV #46

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Spooner commented Jan 25, 2012

Although RUBYLIB and RUBYOPTS are cleared by Ocra, if an Ocra-executable that uses Bundler is run from another instance of Ruby that is using Bundler, then it will think that it should use the calling instance's gemfile and will fail. To combat this, clearing the Bundler environment variables when starting the executable allows this to work.

# This will fail, since the ocra-app will try to use the Gemfile from the calling application.
require 'bundler/setup'
exec 'ocra_app_that_uses_bundler.exe'

tosie commented Jul 16, 2012

This is probably not a bug. You should use the following code to run another process from within a ruby app that uses Bundler:

Bundler.with_clean_env do
  exec 'ocra_app_that_uses_bundler.exe'
end

Spooner commented Jul 16, 2012

Ah, that is good to know! Bundler is filled with black arts:)

Owner

larsch commented Mar 28, 2013

Closing w/o pulling as per tosie's recommendation.

@larsch larsch closed this Mar 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment