2

I got following error for bundle

Bundler could not find compatible versions for gem "bundler": In Gemfile: bundler (~> 1.15)

Current Bundler version: bundler (2.0.1) This Gemfile requires a different version of Bundler. Perhaps you need to update Bundler by running gem install bundler?

Could not find gem 'bundler (~> 1.15)' in any of the relevant sources: the local ruby installation

then I tried to downgrade the bundler version with

$ gem install bundler -v '~> 1.7.0' Fetching: bundler-1.7.15.gem
(100%) Successfully installed bundler-1.7.15 Parsing documentation for bundler-1.7.15 Installing ri documentation for bundler-1.7.15 Done installing documentation for bundler after 1 seconds 1 gem installed

but when I recheck the bundler version with

bundler --version

it still said Bundler version 2.0.1

2 Answers2

3

The default bundler version on your system is still 2.0.1. If you need to use the downloaded version 1.7.15, you would have to run bundle _1.7.15_ install. You could also check if that version was successfully installed on your system using bundle _1.7.15_ -v
In either case, if you get the error Could not find command "_1.7.15_", then that means that the bundler version _1.7.15_ has not been installed on your system.
Additionally, these links may help you:

Anuj Khandelwal
  • 1,214
  • 1
  • 8
  • 16
  • 1
    Also, if the OP doesn't want to use 2.0.1 at all, they can also run `gem uninstall bundler` and choose to uninstall the 2.0.1 version (they may need to reshim if using a ruby version manager) – Jay Dorsey Feb 20 '19 at 14:20
0

Try updating bundle with bundler update bundler and run the bundle update again. It solved my problem the last time.

Vaibhav
  • 628
  • 6
  • 10