Last Updated: February 25, 2016
·
499
· arnaudm

How to launch bundle from a script run under bundle exec

tl;dr

Bundler.with_clean_env do
  system "cd childDir && bundle install"
end

I got mad trying to figure out why this:

system "export BUNDLE_GEMFILE=childDir/Gemfile && bundle install"

would not work as expected.

Complete article

https://makandracards.com/makandra/15649-how-to-discard-a-surrounding-bundler-environment