プロジェクト

全般

プロフィール

Vote #81546

完了

Bundler fails to install globalid when using Ruby < 2.6.0

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Gems support_45
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
45
version_id:
167
issue_org_id:
35621
author_id:
332
assigned_to_id:
332
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
164
ステータス-->[Closed]

説明

The latest version of "globalid":https://rubygems.org/gems/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

journals

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).

<pre><code class="diff">
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'
</code></pre>

--------------------------------------------------------------------------------
Committed the fix.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリGems support_45 にセット
  • 対象バージョン4.1.4_167 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0