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
Rails (every version) no longer installs on Ruby 2.5 due to GlobalID 0.5 #42931
Comments
I was able to repro on using But I was also able to workaround the issue with a |
Hey sorry about this, we figured Rubygems (and Bundler for later |
|
Good to know! We ran into this issue with an Ansible automation script that was starting with a clean VM each time. I suspect it is just using the rubygems that ships with 2.5. I was going to "fix" it by having Ansible edit: Confirmed that a |
I've just shipped globalid 0.5.2 to circumvent this since it's a gem under our purview. We may likely bump to 2.7+ when Rails 7 ships with the same requirement, but that's for later. Thanks for the issue! Glad we found the |
0.5.1 (2021-07-27) * New: Allow expiration to be turned off globally #128 * Fixed: Support for ruby-head #132 * Maintainance: Drop support for EOL'ed Rubies (< 2.6.0) and Rails 4.2 0.5.2 (2021-08-02) * Add back Ruby 2.5 support so gem install rails works out of the box, thereby satisfying Rails' Ruby version requirement. See rails/rails#42931
Steps to reproduce
From a clean machine with no versions of
globalid
already installed (orgem uninstall globalid
to remove it)Install Ruby 2.5.*
Install Rails 6.1.4 (pick any version. even versions from 7 yrs ago has a dependency specification
globalid >= 0.{something}
)Expected behavior
According to the Rails gemspec, Ruby 2.5.0 should be supported:
https://github.com/rails/rails/blob/v6.1.4/rails.gemspec#L12
Rails should install successfully, as it always had (until last week)
Actual behavior
This is due to transitive dependency
globalid
dropping ruby 2.5 support, but rails still claims to support it.Dependency tree:
rails 6.1.4: https://github.com/rails/rails/blob/v6.1.4/rails.gemspec#L37
activejob: https://github.com/rails/rails/blob/v6.1.4/activejob/activejob.gemspec#L35
globalid: https://github.com/rails/globalid/blob/main/globalid.gemspec#L8
This drop of ruby support was made in the update from globalid 0.4 to 0.5.
I believe
activejob
should have it's dependency set to>= 0.3.6
<5.0.0
However all past versions of Rails (going back 7 yrs at least) had the dependency
globalid >= ...
so globalid has to be futureproof forever and never drop any version of ruby. (the real issue is that>
should probably never be used as a transitive dependency version range)System configuration
Rails version: 6.1.4 (any version will cause the same error though)
Ruby version: 2.5.0 (anything 2.5.* will cause the issue)
Workarounds
For those that run into this issue:
Workaround 1:
One workaround is given in the error output. If you manually install
globalid 0.4.2
first, thengem install
will use that already installed version instead of trying to pick up the latest0.5.1
will install successfully
Workaround 2:
As mentioned in the comments, it seems that newer versions of rubygems will automatically resolve this by falling back to the latst version that supports your version of ruby. However rubygems that ships with 2.5 did not have this feature. You can upgrade rubygems after installing ruby to resolve this issue.
The text was updated successfully, but these errors were encountered: