RVM设置在ruby-2.4.0
上,我创建了具有版本的新应用程序,
gem 'rails', '4.2.6'
我使用更新了捆绑器,
gem update --system
gem install bundler
bundle version
# Bundler version 2.0.1 (2019-01-04 commit d7ad2192f)
但是我在bundle install
时遇到以下错误,
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.6) was resolved to 4.2.6, 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.6)', in any of the sources.
它要求我需要较低版本的捆绑器,为什么?我应该如何解决上述问题?
安装任何版本为 (<2.0,>= 1.3.0( 的捆绑程序。
例如
gem install bundler -v 1.17.3
然后
bundle _1.17.3_ install
它应该适用于您的情况。
您的Gemfile
指定了与 2.x.x 不兼容的旧捆绑器版本。 尝试运行gem install bundler -v 1.3.0
或您在Gemfile.lock
中列出的任何版本(检查文件末尾(。