Bundler 2.0.1 installed, Rails says “must use Bundler 2 or greater”?

前端 未结 5 1738
天命终不由人
天命终不由人 2020-12-15 17:45

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

相关标签:
5条回答
  • 2020-12-15 17:58

    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 -v

    $ Bundler version 1.16.1  
    

    I updated bundlere version using-

    $ gem install bundler -v 2.0.1
    

    And got issue resolved!

    0 讨论(0)
  • 2020-12-15 18:02

    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

    0 讨论(0)
  • 2020-12-15 18:13

    This helped me: gem update --system

    0 讨论(0)
  • 2020-12-15 18:19

    This is my solution:

    1. (if you have an old version of Bundler), run the command:

      bundle update --bundler

    2. Run the command:

      gem update --system

    3. run the rake

      rake db:migrate

    0 讨论(0)
  • 2020-12-15 18:19

    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.

    0 讨论(0)
提交回复
热议问题