Update a projects bundler version
We use bundler to maintain a projects gems. Unfortunately bundler v1 itself is incompatible with bundler v2.
If you need to upgrade bundler on a managed server to the latest version you can do:
gem install bundler -v '~>2'
After you installed bundler v2, tell bundler to update your Gemfile.lock and bundler binary
bundle update --bundler bundle install
Common issues / mistakes:
- Be careful!
bundler update --bundler produces nearly the same output, but does not update your Gemfile.lock
Even if some people on the web say the
bundler binaries can be used interchangeably.
- Rubygems can't find bundle executable
- Do not change the bundler version in your Gemfile.lock manually, it may work on your local machine, but not on the server.
If you do not need bundler v1 anymore, uninstall the old version with
gem uninstall bundler
Rubygems asks you which version of bundler you want to uninstall.
Now update the project on your local machine the same way, and deploy it to the server.