Defect #30353

Installing rails with Bundler 2.0 fails in 3.x

Added by Tatsuya Saito 2 months ago. Updated about 1 month ago.

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

0%

Category:Gems support
Target version:3.4.8
Resolution:Fixed Affected version:3.4.7

Description

"bundle install" fails in 3.x because bundler 2.0 was released on January 03, 2019, and rails 4.2.11 gem require bundler gem < 2.0 .
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.


Related issues

Related to Redmine - Defect #19172: "gem update bundler" suggestion for "`x64_mingw` is not a... Closed

Associated revisions

Revision 17781
Added by Go MAEDA 2 months ago

Require bundler >= 1.5.0 (#30353).

Revision 17782
Added by Go MAEDA 2 months ago

Merged r17781 from trunk to 4.0-stable (#30353).

Revision 17783
Added by Go MAEDA 2 months ago

Require bundler >= 1.5.0 and < 2.0.0 (#30353).

History

#1 Updated by Holger Just 2 months ago

  • Status changed from New to Resolved
  • Resolution set to Wont fix

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

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

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

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

# Now you can use bundler as before
bundle install

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.

#2 Updated by Go MAEDA 2 months ago

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.

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" 

[Before]

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)

[After]

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

#3 Updated by Marius BALTEANU 2 months ago

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?

#4 Updated by Go MAEDA 2 months ago

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.

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" 

#5 Updated by Marius BALTEANU 2 months ago

  • Status changed from Resolved to New
  • Target version set to 3.4.8
  • Resolution deleted (Wont fix)

Looks good to me.

#6 Updated by Go MAEDA 2 months ago

  • Related to Defect #19172: "gem update bundler" suggestion for "`x64_mingw` is not a valid platform" added

#7 Updated by Jean-Philippe Lang 2 months ago

  • Status changed from New to Closed
  • Resolution set to Fixed

#8 Updated by Go MAEDA about 1 month ago

  • Assignee set to Go MAEDA

Also available in: Atom PDF