Reinstalling Rubygems

remove and reinstall rubygems (reinstall RVM)

Install rvm again:

Install rvm

To uninstall gem simply,

 gem uninstall <gem-name>

To uninstall a particular version of gem:

gem uninstall <gem-name> --version <gem-version>

How to reinstall a gem using bundler

First I did a gem q --L, the shortcut for gem query --local. It outputs me the all the local gems installed.

actionmailer (3.2.8, 3.2.6, 3.2.1, 3.1.0)
actionpack (3.2.8, 3.2.6, 3.2.1, 3.1.0)
activemodel (3.2.8, 3.2.6, 3.2.1, 3.1.0)
activerecord (3.2.8, 3.2.6, 3.2.1, 3.1.0)
activeresource (3.2.8, 3.2.6, 3.2.1, 3.1.0)
activesupport (3.2.8, 3.2.6, 3.2.1, 3.1.0)
acts-as-taggable-on (2.3.3)
...

And then, following DVG advice, I uninstalled the gem using its correct name gem uninstall acts-as-taggable-on and ran bundle install. After that I was able to rails c or rails s again without any problem.

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

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

Don't reinstall if gem is already installed

You can use the --conservative flag with gem install.

gem install sqlite -v 1.3.8 --conservative

It won't install or update any gems that meet the version requirement.



Related Topics



Leave a reply



Submit