DEV Community

loading...
Cover image for Upgrade to Ruby 3 - uninstall 🙅‍♂️

Upgrade to Ruby 3 - uninstall 🙅‍♂️

Michael
I'm a self-taught dev focused on websites and Python development. My friends call me the "Data Genie". When I get bored, I find tech to read about, write about and build things with.
・1 min read

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

Discussion (0)