Defect #35621

Bundler fails to install globalid when using Ruby < 2.6.0

Added by Go MAEDA 2 months ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Gems support
Target version:4.1.4
Resolution:Fixed Affected version:4.1.3

Description

The latest version of globalid, 0.5.1, reqruies Ruby 2.6 or later (see https://github.com/rails/globalid/commit/5b255ffd7cdb335febe6fa0f3847a39b3161a9bb). Therefore, if you are using Ruby 2.5 or earlier, `bundle install` will fail to resolve the dependency and abort in some environments.

https://www.redmine.org/builds/logs/build_4.2-stable_sqlite3_ruby-2.5_38.html

Fetching globalid 0.5.1 (was 0.4.2)
Installing globalid 0.5.1 (was 0.4.2)
Gem::RuntimeRequirementNotMetError: globalid requires Ruby version >= 2.6.0. The
current ruby version is 2.6.0.rc1.
An error occurred while installing globalid (0.5.1), and Bundler cannot
continue.
Make sure that `gem install globalid -v '0.5.1' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rails was resolved to 5.2.6, which depends on
    actionmailer was resolved to 5.2.6, which depends on
      activejob was resolved to 5.2.6, which depends on
        globalid
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Associated revisions

Revision 21096
Added by Go MAEDA 2 months ago

Bundler fails to install globalid when using Ruby < 2.6.0 (#35621).

Revision 21097
Added by Go MAEDA 2 months ago

Merged r21096 from trunk to 4.2-stable (#35621).

Revision 21098
Added by Go MAEDA 2 months ago

Merged r21096 from trunk to 4.1-stable (#35621).

History

#1 Updated by Go MAEDA 2 months ago

  • Target version set to 4.1.4

The following patch fixes the issue. It avoids Gem::RuntimeRequirementNotMetError by enforcing Bundler to install globalid 0.4.2 if Ruby version is < 2.6.0 (including Ruby 2.6.0-rc1 and 2.6.0-rc2 too).

diff --git a/Gemfile b/Gemfile
index 984cc078a..8474da345 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,6 +4,7 @@ ruby '>= 2.5.0', '< 3.1.0'
 gem 'bundler', '>= 1.12.0'

 gem 'rails', '6.1.4'
+gem 'globalid', '~> 0.4.2' if Gem.ruby_version < Gem::Version.new('2.6.0')
 gem 'rouge', '~> 3.26.0'
 gem 'request_store', '~> 1.5.0'
 gem 'mini_mime', '~> 1.1.0'

#2 Updated by Go MAEDA about 1 month ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix.

#3 Updated by Go MAEDA about 1 month ago

  • Subject changed from Bundler fails to install globalid if Ruby 2.5 or earlier is used to Bundler fails to install globalid when using Ruby < 2.6.0

Also available in: Atom PDF