我当前的 bundler 版本似乎是 1.17.3。我的最新工作实际上需要 1.17.2,但我无法卸载 1.17.3。
如果我运行 gem uninstall bundler
命令退出时没有输出。命令 gem info bundler
始终显示版本 1.17.3。
$ gem uninstall bundler
$ gem info bundler
*** LOCAL GEMS ***
... yada yada yada ...
bundler (1.17.3)
Installed at (default): /Users/disaacs/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0
如果我安装我需要的 bundler 版本,我会安装两个版本,但默认运行 1.17.3 版本。
$ gem install bundler -v 1.17.2
Fetching bundler-1.17.2.gem
Successfully installed bundler-1.17.2
Parsing documentation for bundler-1.17.2
Installing ri documentation for bundler-1.17.2
Done installing documentation for bundler after 3 seconds
1 gem installed
$ gem info bundler
*** LOCAL GEMS ***
... yada yada yada ...
bundler (1.17.3, 1.17.2)
Installed at (1.17.3, default): /Users/disaacs/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0
(1.17.2): /Users/disaacs/.rvm/gems/ruby-2.5.3
The best way to manage your application's dependencies
$ bundle --version
Bundler version 1.17.3
关于如何摆脱 bundler 1.17.3 有什么建议吗?
我的环境是运行 10.14.5 (Mojave) 的 MacBook,通过 rvm 安装了 ruby 2.5.3。
$ rvm list
=* ruby-2.5.3 [ x86_64 ]
# => - current
# =* - current && default
# * - default
最佳答案
简而言之,尝试导航到您的 Rails 项目所在位置以外的位置,然后再次运行 gem uninstall bundler
。
MacOS 10.15.2、Ruby 2.6.5 和 RubyGems 3.0.3
我试图卸载 bundler 2.1.4,而我的默认 bundler 是 1.17.2
$ gem list | grep "bundle"
bundler (2.1.4, default: 1.17.2)
我试过了
$ gem uninstall bundler -v 2.1.4
Gem 'bundler' is not installed
还有
$ gem uninstall bundler
什么都不输出。
最后我 cd 到另一个文件夹并再次运行卸载,它成功了。
关于ruby - 无法卸载 bundle 程序 1.17.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56668174/