find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)

后端 未结 15 1232
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 17:14

I used sudo bundle install and that might be the cause of the issue?

Now I have:

  • gem -v 2.6.14
  • ruby -v
相关标签:
15条回答
  • 2020-11-29 17:54

    My problem was I'm using RVM and had the wrong Ruby version activated...

    Hope this helps at least one person

    0 讨论(0)
  • 2020-11-29 18:00

    The reason is your current ruby environment, you got a different version of bundler with the version in Gemfile.lock.

    • Safe way, install bundler with the same version in Gemfile.lock, this won't break anything if there is some incampatibly thing happened.
    • Hard way, just remove Gemfile.lock, and run bundle install.
    0 讨论(0)
  • 2020-11-29 18:01

    The problem in my case is that the Gemfile.lock file had a BUNDLED_WITH version of 1.16.1 and gem install bundler installed version 2.0.1, so there was a version mismatch when looking to right the folder

    gem install bundler -v 1.16.1 fixed it

    Of course, you can also change your Gemfile.lock's BUNDLED_WITH with last bundler version and use recent software, as Sam3000 suggests

    0 讨论(0)
  • 2020-11-29 18:04

    This fixed it:

    1. Remove Gemfile.lock rm Gemfile.lock
    2. run bundle install again

    EDIT: DON'T DO IT IN PRODUCTION!

    For production go to this answer: https://stackoverflow.com/posts/54083113/revisions

    0 讨论(0)
  • 2020-11-29 18:05

    The real answer is here if you try to install bundler 2.0.1 or 2.0.0 due to Bundler requiring RubyGems v3.0.0

    Yesterday I released Bundler 2.0 that introduced a number of breaking changes. One of the those changes was setting Bundler to require RubyGems v3.0.0. After making the release, it has become clear that lots of our users are running into issues with Bundler 2 requiring a really new version of RubyGems.

    We have been listening closely to feedback from users and have decided to relax the RubyGems requirement to v2.5.0 at minimum. We have released a new Bundler version, v2.0.1, that adjusts this requirement.

    For more info, see: https://bundler.io/blog/2019/01/04/an-update-on-the-bundler-2-release.html

    0 讨论(0)
  • 2020-11-29 18:05

    If you changed the ruby version you're using with rvm use, remove Gemfile.lock and try again.

    0 讨论(0)
提交回复
热议问题