Skip to content

How to uninstall Ruby on a Mac, when rbenv, Homebrew and macOS each have one

Our Mac had five Rubies: two in rbenv, two from Homebrew and Apple's own. Which you can remove, how to remove each, and the one to leave alone.

5 min read

How many Ruby versions do I have?

Run which -a ruby and ls ~/.rbenv/versions. Our Mac had five:

RubyFromSize
3.0.0 and 3.2.3rbenv, in ~/.rbenv/versions182 MB together
3.3.5 and 3.4.4Homebrew238 MB together
Apple's/usr/bin/rubypart of macOS

ruby -v answered 3.0.0, from rbenv, because rbenv's shims came first in the PATH.

How do I uninstall a Ruby version with rbenv?

rbenv uninstall 3.0.0

How do I uninstall rbenv itself?

  1. Remove the rbenv init line from ~/.zshrc and open a new Terminal window.
  2. Move ~/.rbenv to the Trash, which removes every Ruby it installed.
  3. brew uninstall rbenv ruby-build.

How do I remove Homebrew's Ruby?

brew uninstall ruby. Check brew uses --installed ruby first: other tools, such as CocoaPods, may need it.

Can I uninstall the Ruby that comes with macOS?

No, and you should not try. /usr/bin/ruby is part of the protected system, and macOS tools use it.

Gems take space of their own: Ruby gems taking up space.

Common questions

Can I delete Ruby on my Mac?

You can remove Rubies you installed with rbenv, rvm or Homebrew. Apple's /usr/bin/ruby is part of macOS and stays.

How do I uninstall rbenv on Mac?

Remove its init line from ~/.zshrc, move ~/.rbenv to the Trash, and run brew uninstall rbenv ruby-build.

Read next