Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit dc06fab

Browse files
author
Colby Swandale
committed
Merge #6867
It turns out that every existing version of RubyGems will ignore the required RubyGems version and try to install the newest version of Bundler... until the middle of the install, when it will raise an exception and fail. This PR tries to fix that in the least-bad way possible. What was the end-user problem that led to this PR? The end user problem is that running `gem install bundler` now produces an exception on any Ruby and RubyGems older than 2.6 or 3.0 respectively. What was your diagnosis of the problem? Unfortunately, RubyGems does not use the `required_rubygems_version` to select an older version of Bundler to install. Instead, RubyGems tries to install the newest version even though that version is not compatible, and then raises an exception during installation because it is not compatible. What is your fix for the problem, implemented in this PR? Lower the `required_rubygems_version` in Bundler 2 back down to RubyGems 2.5 or greater. Why did you choose this fix out of the possible options? I chose this fix because it will stop RubyGems from raising an exception while installing Bundler 2, and instead allow the installation to complete successfully. There are some bugfixes in RubyGems 3 that improve the quality of life for Bundler 2 users, but they are less bad than RubyGems simply exploding anytime you try to run `gem install bundler`.
2 parents d715ae9 + 31678a3 commit dc06fab

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ matrix:
4747
# 3.x mode
4848
- rvm: 2.5.3
4949
env: RGV=v3.0.1 BUNDLER_SPEC_SUB_VERSION=3.0.0
50+
# Ruby 2.5, Rubygems 2.7 and up
51+
- rvm: 2.5.3
52+
env: RGV=v2.7.7
53+
# Ruby 2.4, Rubygems 2.6 and up
54+
- rvm: 2.4.5
55+
env: RGV=v2.6.14
56+
- rvm: 2.4.5
57+
env: RGV=v2.7.7
58+
# Ruby 2.3, Rubygems 2.5 and up
59+
- rvm: 2.3.7
60+
env: RGV=v2.5.2
61+
- rvm: 2.3.7
62+
env: RGV=v2.6.14
63+
- rvm: 2.3.7
64+
env: RGV=v2.7.7
5065
# Ruby-head (we want to know how we're doing, but not fail the build)
5166
- rvm: ruby-head
5267
env: RGV=master

bundler.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
3434

3535
if s.version >= Gem::Version.new("2.a".dup)
3636
s.required_ruby_version = ">= 2.3.0"
37-
s.required_rubygems_version = ">= 3.0.0"
37+
s.required_rubygems_version = ">= 2.5.0"
3838
else
3939
s.required_ruby_version = ">= 1.8.7"
4040
s.required_rubygems_version = ">= 1.3.6"

0 commit comments

Comments
 (0)