问题
I put some new gems in my Gemfile and ran bundle install
.
The installation went successfully, but at the end I got this warning:
Warning: the lockfile is being updated to Bundler 2, after which you will be unable to return to Bundler 1.
What does this mean - I mean it obviously states that the lockfile is being updated to Bundler2 and I wont be able to return to Bundler 1, and yet, should I be concerned about this? Is there any danger of non-compatibility after this? Why is it updated automatically?
回答1:
It’s not something to worry about unless you need to use the project with Bundler v1 anywhere. The only non-compatibility will be for developers or environments who can only have Bundler v1 installed.
From the documentation:
What happens if my application needs Bundler 2, but I only have Bundler 1 installed?
If you try to use Bundler 1 on an application that requires Bundler 2, you’ll see an error message explaining that you need to install Bundler 2. Go ahead and run
gem install bundler
, and then it should work.
This is an irreversible change, so you can’t go backwards.
Can I downgrade my application from Bundler 2 to Bundler 1?
Bundler 2 does not provide a way to downgrade a Gemfile back to Bundler 1. Instead, we recommend checking in your
Gemfile
andGemfile.lock
before you upgrade your application. That way, if something goes wrong, you can revert to the previous commit and go back to using Bundler 1.
If it updated automatically and you didn’t specify the --bundle
switch, that might be because one of the gems you updated had a dependency on Bundler itself at a more recent version. Check your Gemfile.lock
and see if any gems have Bundler as a dependency.
来源:https://stackoverflow.com/questions/59477399/warning-the-lockfile-is-being-updated-to-bundler-2-after-which-you-will-be-una