【问题标题】:bundle cannot load such file bundler-1.17.1/exe/bundlebundle 无法加载此类文件 bundler-1.17.1/exe/bundle
【发布时间】:2018-10-26 15:38:49
【问题描述】:

我在使用 FileUtils 时遇到了问题,我不得不卸载 gem。在这样做之后,我做了gem update --default 并且一些宝石已经更新。这解决了我的 FileUtils 问题,但现在,bundler 已经死了。

如果我尝试bundle info xxx,我会收到此错误:

Traceback (most recent call last):
    1: from /Users/robin/.gem/ruby/2.5.1/bin/bundle:23:in `<main>'
/Users/robin/.gem/ruby/2.5.1/bin/bundle:23:in `load': cannot load such file -- /Users/robin/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle (LoadError)

红宝石 2.5.1p57 宝石 2.7.7 导轨 5.2.1

我正在使用 chruby,并且安装了 Ruby 2.5.0 和 2.5.1。

我尝试卸载 bundler 并重新安装它,但不起作用。

现在,即使我尝试gem install bundler~/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/ 文件夹中也没有目录。

但是,我安装它时没有错误:

gem install bundler
Successfully installed bundler-1.17.1
Parsing documentation for bundler-1.17.1
Done installing documentation for bundler after 3 seconds
1 gem installed

你有解决这个问题的想法吗?

编辑:

我可以在我的 gem 列表中看到 bundler:

bundler (default: 1.17.1, default: 1.16.2)

如您所见,有两个默认版本... 此外,我在我的 gems 中找不到任何捆绑程序目录,如果我尝试卸载,我会收到以下消息:

ERROR:  While executing gem ... (Gem::InstallError)
    gem "bundler" cannot be uninstalled because it is a default gem

【问题讨论】:

    标签: ruby-on-rails ruby rubygems bundle bundler


    【解决方案1】:

    试试gem pristine bundler,它将宝石恢复到原来的状态。

    【讨论】:

    • 感谢您的回复,但我收到了这条消息:gem pristine bundlerRestoring gems to pristine condition...Skipped bundler-1.16.2, it is a default gemSkipped bundler-1.17.1, it is a default gem
    • 嗯,它应该至少恢复您安装的最后一个版本的捆绑程序。尝试删除所有 ruby​​ 版本和 chruby,重新安装,然后一开始只处理一个版本。这并不理想,但您的问题可能是您为 rubygem 使用不同版本的二进制文件。
    • 非常感谢,我删除了所有 ruby​​ 版本和 chruby,并安装了 rvm。现在它完美地工作了。
    猜你喜欢
    • 2020-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多