Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get `Could not find 'bundler' (1.17.3)` after upgrading Ruby?

Tags:

ruby

bundler

After upgrading from Ruby 2.3 to a newer version and then doing a bundle install I get the error Could not find 'bundler'.

This happens even after doing gem install bundler.

like image 423
Kris Avatar asked Sep 02 '19 14:09

Kris


1 Answers

This is because gem install bundler will install the newer 2.x version of bundler and the Gemfile.lock specifies the version of bundler to use at the bottom.

You can either:

Install bundler 1.x

gem install bundler:1.17.3

If this does not work try deleting Gemfile.lock and doing bundle install.

Upgrade Gemfile.lock to use 2.x

bundle update --bundler
like image 192
Kris Avatar answered Sep 19 '22 19:09

Kris