-
Notifications
You must be signed in to change notification settings - Fork 0
Fix rails new command failing in bundle context #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 24 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (5)
WalkthroughThe Rails app creation command in lib/demo_scripts/demo_creator.rb now prefixes the execution with an empty BUNDLE_GEMFILE environment variable. No other logic or public interfaces were changed. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant DC as DemoCreator
participant Run as Runner
participant Sh as Shell
Dev->>DC: create_rails_app(args)
DC->>Run: run!("BUNDLE_GEMFILE= rails new '<demo_dir>' <args>")
note right of Run: Environment variable BUNDLE_GEMFILE set to empty
Run->>Sh: Execute command
Sh-->>Run: Exit status / output
Run-->>DC: Result
DC-->>Dev: Completion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The rails new command was failing with "can't find executable rails for gem railties" because it was running within the script's Bundler context. This happened because bin/new-demo requires 'bundler/setup', causing Bundler to intercept the rails command and look for railties in the current bundle. Fixed by prefixing the command with BUNDLE_GEMFILE= to escape the bundle context and use the globally installed Rails gem. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The previous fix using BUNDLE_GEMFILE= didn't work because the rails executable wrapper script calls Gem.use_gemdeps which still loads the Gemfile dependencies. Changed approach to use Rails version specifier (rails _8.0.3_ new) which bypasses the bundle context and uses the specified gem version directly. Changes: - Added RAILS_VERSION configuration to Config class and .new-demo-versions - Updated DemoCreator to use rails _VERSION_ new syntax - Added Rails version display in output - Fixed RuboCop style violations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
89e939f to
912ab10
Compare
|
@claude review this pr |
|
Claude finished @justin808's task —— View job PR Review: Fix rails new command failing in bundle contextSummaryThis PR addresses a bundle context issue when creating new Rails apps, but the actual fix is different from what the PR description claims. The description says the fix is to prefix the command with ✅ What Actually Changedlib/demo_scripts/demo_creator.rb:76 # Before:
@runner.run!("bundle exec rails new '#{@demo_dir}' #{all_args}")
# After:
@runner.run!("rails _#{@config.rails_version}_ new '#{@demo_dir}' #{all_args}")The actual fix is:
This is a different approach than using 📋 Review Findings✅ Strengths
|
Summary
rails newcommand failing with "can't find executable rails for gem railties" errorBUNDLE_GEMFILE=Problem
The
bin/new-demoscript was failing when trying to create a new Rails app because:require 'bundler/setup'to load dependenciesrailscommandrailtiesin the current bundle (which doesn't have it)Solution
Prefix the
rails newcommand withBUNDLE_GEMFILE=to temporarily escape the bundle context and use the globally installed Rails gem instead.Test plan
bin/new-demowith the fix applied🤖 Generated with Claude Code
Summary by CodeRabbit