ruby - 无法卸载 bundle 程序 1.17.3

标签 ruby rubygems rvm bundler

我当前的 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/

相关文章:

ruby - 在 Jekyll 页面中使用 Liquid 标签不起作用

ruby - 返回不会打破 ruby ?

ruby - 使用 bundler 时在 gemspec 中声明开发依赖项是否仍然有用?

installation - 在ubuntu 11.04服务器上安装rvm的问题

python - 为什么编程语言同样限制 22/7 的精度?

ruby-on-rails - NoMethodError Rails 3.2

ruby-on-rails - 如何使用 :path and :branch 添加 gem 依赖

ruby-on-rails-3 - bundle install libv8 (therubyracer) 在 Windows 上安装失败(使用 native 扩展)

ruby - rvm help 命令输出看起来很奇怪

mysql - 尝试访问我的 ruby​​ 项目 - 与 mysql 有关的 LoadError