I used sudo bundle install and that might be the cause of the issue?
Now I have:
gem -v 2.6.14ruby -v
My problem was I'm using RVM and had the wrong Ruby version activated...
Hope this helps at least one person
The reason is your current ruby environment, you got a different version of bundler with the version in Gemfile.lock.
Gemfile.lock, this won't break anything if there is some incampatibly thing happened.Gemfile.lock, and run bundle install.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
This fixed it:
rm Gemfile.lockbundle install againEDIT: DON'T DO IT IN PRODUCTION!
For production go to this answer: https://stackoverflow.com/posts/54083113/revisions
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
If you changed the ruby version you're using with rvm use, remove Gemfile.lock and try again.