Vote #79743
完了Installing rails with Bundler 2.0 fails in 3.x
0%
説明
"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"