Mismatched bundler version - bundler 2, ruby 2.6
The diagnose in your answer seems right. But it seems you can activate the latest installed Bundler gem (installed by gem install bundler
) by adding this before the require 'bundler/setup'
line:
Gem::Specification.find_by_name('bundler').activate
More specific version requirements can also be used if needed. For example:
Gem::Specification.find_by_name('bundler', '~> 2.0.1').activate
find_by_name
throws LoadError
derived exception if the gem is not found.
Bundler: You must use Bundler 2 or greater with this lockfile
I deleted the project and made a git clone from the Heroku app, don´t know if it is a good solution, but it worked for me.
Bundler 2.0.1 installed, Rails says must use Bundler 2 or greater?
I ran into the same issue & resolved it by downgrading with gem uninstall bundler
, followed by gem install bundler -v 1.17.3
to revert back to the last pre 2 version.
I saw this across 3 separate systems using different version managers (ASDF, rbenv, rvm) and this resolved the issue.
There is some information on getting both versions to play nicely here. The root cause of this issue may have been a bug (which appears to have since been fixed)
Per the comment from @MatijsvanZuijlen below, and the bundler documentation, you should also be able to specify which version of bundler you want to use at runtime with bundle _1.17.3_ install
Travis builds on Ruby 2.6.3 have bundler version mismatch
Have you tried a before_install
step to upgrade bundler
before it attempts bundle gem install
?
before_install: gem update bundler
Warning: the running version of Bundler is older than the version that created the lockfile error
Just run gem install bundler:2.1.4
, don't worry about the older version that comes with ruby, it should not be used.
[Trying to Deploy]: You must use Bundler 2 or greater with this lockfile
Remove your
Gemfile.lock
Install old version of bundler, for example
gem install bundler -v 1.17.3
- Run this bundler in your project directory
bundle _1.17.3_ install
- Make any commit, for example
git commit -am "Bundler 1.17.3 was installed"
- Run
git push heroku master
- Smile
You must use Bundler 2 or greater with this lockfile. When running docker-compose up locally
Adding this line before RUN bundle install to the Dockerfile did the trick for me.
RUN gem install bundler -v 2.0.1
Leaving this here for future reference!
Related Topics
How to Redefine Fixnum's + (Plus) Method in Ruby and Keep Original + Functionality
Rmagick - How to Find Out the Pixel Dimension of an Image
Activerecord Connection Warning. (Database Connections Will Not Be Closed Automatically)
How Do Version Numbers Work for Mri Ruby
Errno::Eaccess: Permission Denied @ Dir_S_Mkdir
Ruby on Rails - Doesn't Create Script/Server
Converting a Unique Seed String into a Random, Yet Deterministic, Float Value in Ruby
Can't Get to Work Cocoapods and Yosemite
How to Summarize Array of Integers as an Array of Ranges
How to Use "_Blank" or "_New" in Rails
Using Bsearch to Find Index for Inserting New Element into Sorted Array
Bootstrap Datepicker Default Value Simple_Form_For
Ruby String Split with Terminal Strings Empty
How to Do String Comparison in Ruby