Commit b91fb94
committed
with_original_env so BUNDLER_APP_CONFIG is honored
Bundler's `with_clean_env` completely erases all Bundler-related
environment variables, even if those variables existed prior to loading
Bundler. That means that custom Bundler settings that we legitimately
want to pass down to child processes - namely, `BUNDLE_APP_CONFIG` - are
erased, leading to errors when the child process loads `bundler/setup`.
Note that `with_clean_env` is actually deprecated by Bundler. The method
recommended by Bundler going forward, and the one used in this commit,
is `with_original_env`. This clears any variables that were set by
Bundler itself, but retains any user-supplied settings that existed
prior.
This fixes a bug where spring binstubs would fail if `BUNDLE_APP_CONFIG`
was set to a custom location (i.e. other than the default `./.bundle`)
and `bundle install --path` was used. The binstub would not be able to
load the bundle because without `BUNDLE_APP_CONFIG`, it could not know
the path where the gems were installed.1 parent f0d2d65 commit b91fb94
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
0 commit comments