Commit d4f7d8e
Fix generator inheriting BUNDLE_GEMFILE from parent process
Wrap bundler commands in install_generator.rb with
Bundler.with_unbundled_env to prevent BUNDLE_GEMFILE inheritance
from the parent process. This fixes "injected gems" conflicts
when running `bundle exec rails g react_on_rails:install`.
The issue occurs because system() calls inherit the parent's
BUNDLE_GEMFILE environment variable, causing bundler to use the
wrong Gemfile when the generator runs bundle commands.
This is a well-documented Bundler issue (rubygems/bundler#698,
rails/rails#3153) and the fix follows the official solution
recommended by Bundler maintainers since 2012.
Fixes #2287
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent 619cb78 commit d4f7d8e
1 file changed
Lines changed: 3 additions & 3 deletions
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
0 commit comments