1

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?

Huy Vo
  • 2,418
  • 6
  • 22
  • 43
  • 6
    Possible duplicate of [How to uninstall all gems installed using \`bundle install\`](https://stackoverflow.com/questions/21384664/how-to-uninstall-all-gems-installed-using-bundle-install) – Joe Apr 29 '18 at 16:15

2 Answers2

1

This is basically a duplicate question

This answer is probably best in your case:

gem list --no-versions | xargs gem uninstall -a
lacostenycoder
  • 10,623
  • 4
  • 31
  • 48
0

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 :)

joel1di1
  • 773
  • 5
  • 13