bundle cannot load such file bundler-1.17.1/exe/bundle

回眸只為那壹抹淺笑 提交于 2019-12-25 03:49:17

问题


I had a problem with FileUtils and I had to uninstall the gem. After did this, I did gem update --default and some gems have been updated. That fixed my problem with FileUtils but now, bundler is dead.

If I try bundle info xxx I get this error:

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)

ruby 2.5.1p57 gem 2.7.7 Rails 5.2.1

I'm using chruby and I have Ruby 2.5.0 and 2.5.1 installed.

I tried to uninstall bundler and reinstall it but that doesn't work.

Now, even if I try gem install bundler, there's no directory in the ~/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/ folder.

However, I have no error when I install it:

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

Do you have an idea to solve this problem?

EDIT:

I can see bundler in my gem list:

bundler (default: 1.17.1, default: 1.16.2)

And as you can see, there's two default versions... Also, I can't find any bundler directory in my gems and if I try to uninstall I get this message:

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

回答1:


Try gem pristine bundler, that restores the gem to it's original state.



来源:https://stackoverflow.com/questions/53012107/bundle-cannot-load-such-file-bundler-1-17-1-exe-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!