Created
April 19, 2012 04:15
-
-
Save rsutphin/2418518 to your computer and use it in GitHub Desktop.
Demonstrating an issue with Bundler.with_clean_env and local path installs (#1858)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bundle | |
Gemfile.lock | |
local-bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Actual gems are not important | |
source :rubygems | |
gem 'thor' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf .bundle 'local-bundle' | |
bundle install --path 'local-bundle' | |
echo "Shell GEM_HOME (may be blank):" | |
env | grep GEM_HOME | |
echo "bundle exec GEM_HOME:" | |
bundle exec env | grep GEM_HOME | |
echo "with_original_env GEM_HOME:" | |
bundle exec ruby -e 'Bundler.with_original_env { system("env") }' | grep GEM_HOME | |
echo "with_clean_env GEM_HOME:" | |
bundle exec ruby -e 'Bundler.with_clean_env { system("env") }' | grep GEM_HOME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I run
reproduce.sh
with my system ruby on the path, I get this:If I run it with some rvm ruby selected, I get this:
In both cases, the "original" and "clean" envs are tainted with the GEM_HOME set by bundler.