DEV Community

Cover image for Upgrade to Ruby 3 - uninstall 🙅‍♂️
Michael Currin
Michael Currin

Posted on

Upgrade to Ruby 3 - uninstall 🙅‍♂️

How to remove Ruby and gems from your system

Remove gems ❌ 📦

Delete custom gems installed at the user level - only your user could run them.

$ rm -rf ~/.gem
Enter fullscreen mode Exit fullscreen mode

Delete system-wide custom gems - any user could run them. If only root has access to modify this directory, then you'll need to run with sudo.

$ rm -rf /usr/local/lib/ruby/
Enter fullscreen mode Exit fullscreen mode

That directory contains gems/ and site_ruby by the way.

Remove Ruby 🙅‍♂️ 💎

Remove the custom Ruby using your package manager.

macOS

$ brew uninstall ruby
Enter fullscreen mode Exit fullscreen mode

Linux

$ sudo apt remove ruby ruby-dev
Enter fullscreen mode Exit fullscreen mode

Or, if you installed as ruby-full, then run:

$ sudo apt remove ruby-full
Enter fullscreen mode Exit fullscreen mode

Top comments (0)