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

Discussion (0)