プロジェクト

全般

プロフィール

Vote #79743

完了

Installing rails with Bundler 2.0 fails in 3.x

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

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

0%

予定工数:
category_id:
45
version_id:
144
issue_org_id:
30353
author_id:
28393
assigned_to_id:
332
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
143
ステータス-->[Closed]

説明

"bundle install" fails in 3.x because "bundler 2.0 was released on January 03, 2019":https://rubygems.org/gems/bundler, and rails 4.2.11 gem require "bundler gem < 2.0":https://rubygems.org/gems/rails/versions/4.2.11 .
Log in my case.

$ ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux]
$ bundle --version
Bundler version 2.0.1
$ gem --version
2.6.14
$ bundle install --path vendor/bundle
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 4.2.11) was resolved to 4.2.11, which depends on
      bundler (< 2.0, >= 1.3.0)
  Current Bundler version:
    bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
(= 4.2.11)', in any of the sources.

journals

You can (and need) to install an older version of bundler which is compatible with the Rails version used by of Redmine 3.4.

<pre>
gem install bundler -v 1.17.3 # Currently the latest bundler version < 2.0
bundle _1.17.3_ install
</pre>

Alternatively, you can also remove bundler 2.x completely and only use Bundler 1.x:

<pre>
gem uninstall bundler -v ">= 2.0"
gem install bundler -v "< 2.0"

# Now you can use bundler as before
bundle install
</pre>

Since there will likely not be any further update of Rails 4.x to update these dependencies, you can either use one of those options or update to Redmine 4.0 which used Rails 5.2 which in turn is compatible with Bundler 2.0.
--------------------------------------------------------------------------------
How about updating Gemfile like this? It can make the error messages a bit simpler. It may be easier for users to pinpoint the cause of the problem.

<pre><code class="diff">
Index: Gemfile
===================================================================
--- Gemfile (revision 17769)
+++ Gemfile (working copy)
@@ -1,8 +1,6 @@
source 'https://rubygems.org'

-if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.5.0')
- abort "Redmine requires Bundler 1.5.0 or higher (you're using #{Bundler::VERSION}).\nPlease update with 'gem update bundler'."
-end
+gem "bundler", ">= 1.5.0", "< 2.0.0"

gem "rails", "4.2.11"
gem "addressable", "2.4.0" if RUBY_VERSION < "2.0"
</code></pre>

*[Before]*
<pre>
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.2.11) was resolved to 4.2.11, which depends on
bundler (>= 1.3.0, < 2.0)

Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (>= 1.3.0, < 2.0)', which is required by gem 'rails
(= 4.2.11)', in any of the sources.

Bundler could not find compatible versions for gem "nokogiri":
In Gemfile:
nokogiri (~> 1.8.1)

capybara (~> 2.13) was resolved to 2.18.0, which depends on
nokogiri (>= 1.3.3)

rails-dom-testing was resolved to 2.0.3, which depends on
nokogiri (>= 1.6)

roadie (~> 3.2.1) was resolved to 3.2.2, which depends on
nokogiri (~> 1.5)

Bundler could not find compatible versions for gem "roadie":
In Gemfile:
roadie (~> 3.2.1)

roadie-rails (~> 1.1.1) was resolved to 1.1.1, which depends on
roadie (~> 3.1)
</pre>

*[After]*
<pre>
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (>= 1.5.0, < 2.0.0)

Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (>= 1.5.0, < 2.0.0)' in any of the relevant sources:
the local ruby installation
</pre>
--------------------------------------------------------------------------------
Go MAEDA wrote:
> How about updating Gemfile like this? It can make the error messages a bit simpler. It may be easier for users to pinpoint the cause of the problem.

I'm favour of this change. In which branches do you think to commit it?
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Go MAEDA wrote:
> > How about updating Gemfile like this? It can make the error messages a bit simpler. It may be easier for users to pinpoint the cause of the problem.
>
> I'm favour of this change. In which branches do you think to commit it?

#30353#note-2 for 3.4-stable, and the following patch for the trunk and 4.0-stable.

<pre><code class="diff">
Index: Gemfile
===================================================================
--- Gemfile (revision 17778)
+++ Gemfile (working copy)
@@ -1,8 +1,6 @@
source 'https://rubygems.org'

-if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.5.0')
- abort "Redmine requires Bundler 1.5.0 or higher (you're using #{Bundler::VERSION}).\nPlease update with 'gem update bundler'."
-end
+gem "bundler", ">= 1.5.0"

gem "rails", "5.2.2"
gem "rouge", "~> 3.3.0"
</code></pre>
--------------------------------------------------------------------------------
Looks good to me.
--------------------------------------------------------------------------------

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

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

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


related_issues

relates,Closed,19172,"gem update bundler" suggestion for "`x64_mingw` is not a valid platform"

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

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

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

いいね!0
いいね!0