Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force Bundler to reinstall all of my gems?

Tags:

bundler

How do I force Bundler to reinstall all of the gems in my gemfile? Or, how do I force Bundler to uninstall all of the gems it installed so I can then reinstall them myself?


I saw rails bundle clean, but this question explains how to remove gems that bundle installed but are no longer in the gemfile.

And How to reinstall a gem using bundler explains how to reinstall a single gem. I would like to reinstall all of my gems at once.

like image 533
Kevin Avatar asked Jul 24 '17 21:07

Kevin


People also ask

How do I fix a run bundle to install missing gems?

In the invoked popup, start typing bundler, select bundle install and press Enter . Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .

How do I uninstall and reinstall a gem?

If you've installed into ./bundle/vendor or similar, you need to remove the gem first but explicitly specify the GEM_HOME, e.g. This is by far the simplest way to uninstall gems installed using bundler into a vendor directory. Ideally, there would be a command bundle uninstall or bundle reinstall , etc.

What does bundle clean -- force do?

This command will remove all unused gems in your bundler directory. This is useful when you have made many changes to your gem dependencies.

How do I resolve gem dependencies?

Common Attempts To Resolve Ruby Gem Dependencies Bundler can help to resolve dependencies when working with Ruby gems by allowing you to specify a set of gems in a Gemfile, then issue a single command to install them. Bundler then automatically resolves the dependencies for you.


2 Answers

bundle install --redownload 

See the reference for bundle install: https://bundler.io/v2.2/man/bundle-install.1.html

or

bundle install --force 

For older versions of bundler

like image 68
Kevin Avatar answered Oct 03 '22 18:10

Kevin


Another way to deal with gem problems can be to sudo gem clean instead of reinstalling everything

like image 38
Jose Paez Avatar answered Oct 03 '22 17:10

Jose Paez