我加入了一个正在使用 Bundler 版本 1.17.1 的项目。目前我的系统正在使用 Bundler 2.0.2。是否有办法像使用 rbenv
指定 Ruby 版本一样指定 Bundler 版本?例如:
bundler --global 1.17.1
因此,当我运行命令bundler -v
时,我将收到结果1.71.1
而不是2.0.2
。
我尝试使用gem uninstall bundler
卸载当前的bundler并收到了这个消息:
$ gem uninstall bundler
Select gem to uninstall:
1. bundler-1.17.1
2. bundler-1.17.3
3. bundler-2.0.2
4. All versions
>
这让我想到有一种方法可以让我使用多个打包工具版本。如果您能指出我应该查找哪些线索,我将不胜感激。
编辑1
我尝试了 bundle _1.17.1_ --version
,但它并没有像我预期的那样工作。
$ bundler -v
Bundler version 2.0.2
$ bundle _1.17.1_ --version
Bundler version 1.17.1
$ bundler -v
Bundler version 2.0.2
期望版本: Bundler 1.17.1
实际版本: Bundler 2.0.2
bundle _1.17.1_ install
- You Nguyen> file ~/.gems/gems/bundler-1.17.1
的输出是/Users/iulian/.gems/gems/bundler-1.17.1: directory
,而> bundle _1.17.1_ --version
的输出是Bundler version 2.0.2
。 - Iulian Onofreibundle _1.3.0_ install
时,我总是收到“找不到命令“_1.3.0_”的错误提示。 - David Geismar