'Uninstall all installed gems in a Rails project
First, I did not use rvm or rbenv. I want to uninstall every gem in my Rails project and then bundle from the beginning. Gem installation directory is pointing to my global directory so I can't just delete that one.
In modern Javascript projects, you can simply rm -rf node_modules and npm/yarn install instantly, is there a similar way in Rails?
Solution 1:[1]
Well, rvm or rbenv are useful, consider using one of them.
You're using bundle, so if you want to make sure your command line only use the gems indicated in your Gemfile, you can just add "bundle exec your_command", like bundle exec rails s. So, it might be unnecessary to delete all the gems.
If you want to save place, my best advice would be to empty your global directory, use rbenv or rvm :)
Solution 2:[2]
This is basically a duplicate question
This answer is probably best in your case:
gem list --no-versions | xargs gem uninstall -a
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | joel1di1 |
| Solution 2 | lacostenycoder |
