首页 > 解决方案 > 无法卸载捆绑程序 1.17.3

问题描述

我当前的捆绑器版本似乎是 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

如果我安装了我需要的捆绑程序版本,我会安装两个版本,但默认运行 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

关于如何摆脱捆绑器 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

标签: rubyrubygemsrvmbundler

解决方案


简而言之,尝试导航到您的 rails 项目所在位置以外的位置,然后gem uninstall bundler再次运行。


MacOS 10.15.2、Ruby 2.6.5 和 RubyGems 3.0.3

我试图卸载捆绑器 2.1.4,而我的默认捆绑器是 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 到另一个文件夹并再次运行卸载,它工作。


推荐阅读