Bundler 2.0.1 installed, Rails says "must use Bundler 2 or greater"?
I'm a Rails newb who's trying out Rails on a DigitalOcean droplet. The installations seemed to work fine, but I'm getting a curious error message when I try to generate a scaffold:
DO 10:48 Rails/simple (master) → rails generate scaffold User name:string email:string Traceback (most recent call last): 5: from bin/rails:3:in `<main>' 4: from bin/rails:3:in `load' 3: from /home/tony/rails/simple/bin/spring:10:in `<top (required)>' 2: from /home/tony/rails/simple/bin/spring:10:in `new' 1: from /home/tony/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize' /home/tony/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError) DO 10:49 Rails/simple (master) → bundle list bundler /home/tony/.rvm/gems/ruby-2.6.0/gems/bundler-2.0.1 DO 10:50 Rails/simple (master) → gem list bundler *** LOCAL GEMS *** bundler (2.0.1, default: 1.17.2) bundler-unload (1.0.2) rubygems-bundler (1.4.5)
I.e., the current Bundler gem is version 2.0.1, but Rails still thinks it's insufficient.
I can't find anything similar on the web. The only red flag I can see is that the bundler gem shows a default version of 1.17.2. How do I begin to diagnose the problem?
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
How to Upgrade to Bundler 2, If you need to upgrade RubyGems, run gem update --system . All set? Ruby and RubyGems versions new enough? Great. Keep going. Installing Bundler 2. The [Yn] y Removing bundle Removing bundler Successfully uninstalled bundler-2.0.1 ~ 10:40 $ bundle --version rbenv: bundle: command not found The `bundle' command exists in these Ruby versions: 2.3.7 2.5.3 -127 ~ 10:40 $ gem install bundler Fetching: bundler-2.0.1.gem (100%) Successfully installed bundler-2.0.1 1 gem installed ~ 10:40 $ bundle
This helped me:
gem update --system
Bundler 2 is already installed, still getting "You must use Bundler 2 , The Gemfile.lock states at the bottom: BUNDLED WITH 2.0.1 Bundler Version: Rails Test failing even though Bundler 2 is installed I am seeing a similar issue as well, if I delete Gemfile.lock and run bundle again, it says I'm at a loss. When I gem uninstall bundler. it says it's uninstalled but then gem list | grep bundle reveals 2.0.1 and default 1.17 is still installed. and of course running bundle install to create a new Gemfile.lock says it's bundled with 2.0.1!! This is maddening.
This is my solution:
(if you have an old version of Bundler), run the command:
bundle update --bundler
Run the command:
gem update --system
run the rake
bundler version 2.0.1 fails to run · Issue #6882 · rubygems/bundler , To add to what @anatol said, we also have rubygems 3.0.2 but it still doesn't seem to Just after installing the ruby 2.6.0, I get stuck to bundler 1.17.2 : To install the missing version, run `gem install bundler:2.0.1` remote: ! gem uninstall bundler -v ">= 2.0" gem install bundler -v "< 2.0" # Now you can use bundler as before bundle install Since there will likely not be any further update of Rails 4.x to update these dependencies, you can either use one of those options or update to Redmine 4.0 which used Rails 5.2 which in turn is compatible with Bundler 2.0.
After you try any of the solutions above, restart your terminal window.
I was stuck with my terminal showing 2 versions of bundler even when i uninstalled the old version until i killed terminal and opened a new window.
How to install and bundle your rails application with a specific , LOCAL GEMS *** bundler (1.17.1, 1.16.6, 1.16.5). Now, let's say we want to install version 2.0.1, type: $ gem install bundler -v 2.0.1. Fetching: To install it the usual way, run gem install bundler and RubyGems will install the latest version of Bundler. Version Autoswitch Now that you have Bundler 2 installed, you should know that Bundler will automatically switch between version 1 and version 2 based on your application’s Gemfile.lock .
I got issue after updating ruby version(2.4.6) as-
You must use Bundler 2 or greater with this lockfile.
Here is how I resolved it-
When i checked bundler version
$ Bundler version 1.16.1
I updated bundlere version using-
$ gem install bundler -v 2.0.1
And got issue resolved!
Bundler Version, When deploying a Ruby application to Heroku, a version of Bundler will be installed and gem install bundler -v 2.0.1 bundle update --bundler. > Bundler 2 no longer supports versions of Ruby that are so old they > have been abandoned by the ruby-core team. That includes Ruby 2.2 and > older.
Building a Ruby Project - Travis CI, Travis CI uses Bundler to install your Ruby project's dependencies if there is a A subsequent 2.0.1 release lowered the required RubyGems version to 2.5.0, so to avoid running tests for, say, CRuby 1.9.3 multiple times you need to add Bundle complete! 2 Gemfile dependencies, 7 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. $ git diff --- a/Gemfile.lock +++ b/Gemfile.lock BUNDLED WITH - 1.17.2 + 2.1.0.pre.2. That changes is annoying. Suppose I’m contributing to Rails and I’m just doing bundle install (without modifying any Gemfile).
RubyGems can't find bundle executable although Bundler is installed, gem install bundler Successfully installed bundler-2.0.1 1 gem installed 1: from /home/henning/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in Now, let's say we want to install version 2.0.1, type: $ gem install bundler -v 2.0.1 Fetching: bundler-2.0.1.gem (100%) Successfully installed bundler-2.0.1 1 gem installed To uninstal this specific version, type: $ gem uninstall bundler -v 2.0.1 How to bundle an application with a specific bundler version
bundler | RubyGems.org, bundler 2.0.1. Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably Then it is perfectly happy to install Rails 4.0.8 -- this time with sass-rails 4.0.3, the most recent sass-rails too. Gemfile.lock In the first case, rails 4.0.8 and sass-rails 4.0.3 would still seem to be the most recent gems that satisfy the dependencies expressed.