You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix bin/dev pack generation failure when run from Bundler context
When bin/dev loads bundler/setup and then PackGenerator tries to run
"bundle exec rake", it fails due to Bundler path conflicts. The system
command tries to spawn a new bundle process from within an already-setup
Bundler environment, causing Ruby/Bundler version mismatches.
Solution: Detect if we're already in a Bundler context and directly
invoke the Rake task instead of shelling out to "bundle exec rake".
This avoids the nested Bundler issue while maintaining compatibility
with non-Bundler environments.
Changes:
- lib/react_on_rails/dev/pack_generator.rb:
- Add run_pack_generation method to detect Bundler context
- Add run_rake_task_directly to invoke Rake task in-process
- Add run_via_bundle_exec for non-Bundler environments
- Load Rails environment when needed for in-process execution
Fixes: bin/dev static (and other bin/dev commands) now successfully
generate packs before starting the development server.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments