当我尝试捆绑一个新项目的gemfile时,我得到了:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler-audit was resolved to 0.6.0, which depends on
bundler (~> 1.2)
rails (~> 5.2) was resolved to 5.2.1, which depends on
bundler (>= 1.3.0)
Current Bundler version:
bundler (2.0.2)
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.2)', which is required by gem 'rails (~>
5.2)', in any of the sources.
结果,我运行gem install bundler '~> 1.2'
。
现在,当我运行gem list bundler
时,我有这两个版本2.0.2、1.17.3
我知道要将我的gemfile与版本1.17.3捆绑在一起
但是,当我运行bundle _1.17.3_ install
时,我得到:
Could not find command "_1.17.3_"
。
我在这里做错了什么?我该如何解决?有没有一种方法可以在我的Rails项目中直接指定应该使用哪个版本的捆绑程序下载并解决依赖项?
答案 0 :(得分:0)
先尝试gem install bundler -v 1.17.3
,然后再尝试bundle _1.17.3_ install