-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix gem exec rails new project failing on Ruby 3.2
#7960
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
Merged
deivid-rodriguez
merged 3 commits into
master
from
deivid-rodriguez/vendor-securerandom
Aug 28, 2024
Merged
Fix gem exec rails new project failing on Ruby 3.2
#7960
deivid-rodriguez
merged 3 commits into
master
from
deivid-rodriguez/vendor-securerandom
Aug 28, 2024
Conversation
This file contains hidden or 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
94f3ac9 to
026ed9a
Compare
indirect
approved these changes
Aug 23, 2024
The default version of securerandom (0.2.2) gets activated by RubyGems, but does not match Rails requirements (>= 0.3), leading to an error like this: ``` $ gem exec rails new repro /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:2246:in `raise_if_conflicts': Unable to activate activesupport-7.2.1, because securerandom-0.2.2 conflicts with securerandom (>= 0.3) (Gem::ConflictError) from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1383:in `activate' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1421:in `block in activate_dependencies' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1403:in `each' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1403:in `activate_dependencies' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1385:in `activate' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/core_ext/kernel_gem.rb:62:in `block in gem' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/core_ext/kernel_gem.rb:62:in `synchronize' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/core_ext/kernel_gem.rb:62:in `gem' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/exec_command.rb:193:in `activate!' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/exec_command.rb:73:in `execute' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command.rb:326:in `invoke_with_build_args' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:255:in `invoke_command' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:194:in `process_args' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:152:in `run' from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/gem_runner.rb:56:in `run' from /Users/deivid/code/rubygems/rubygems/exe/gem:12:in `<main>' ``` Vendoring our own securerandom fixes the issue since that way we avoid activating the gem internally.
026ed9a to
0ae5e12
Compare
|
❤️ |
Closed
byroot
reviewed
Aug 28, 2024
deivid-rodriguez
added a commit
that referenced
this pull request
Sep 17, 2024
…random Fix `gem exec rails new project` failing on Ruby 3.2 (cherry picked from commit 7de3224)
deivid-rodriguez
added a commit
that referenced
this pull request
Sep 17, 2024
…random Fix `gem exec rails new project` failing on Ruby 3.2 (cherry picked from commit 7de3224)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the end-user or developer problem that led to this PR?
On Ruby 3.2, when running
gem exec rails new project, the default version of securerandom (0.2.2) gets activated, but does not match Rails requirements (>= 0.3), leading to an error like this:What is your fix for the problem, implemented in this PR?
Vendor securerandom.
Make sure the following tasks are checked