12

I just installed ruby via

brew install ruby

I have been advised to install it via RVM, even if I use Homebrew, but first I want to uninstall the ruby that homebrew just installed.

Can I simply do

brew uninstall ruby

Or do I need to do something else?

k1eran
  • 4,492
  • 8
  • 50
  • 73
TechRemarker
  • 2,788
  • 11
  • 37
  • 60
  • http://stackoverflow.com/questions/7323261/uninstall-remove-a-homebrew-package-including-all-its-dependencies – Zabba Sep 05 '12 at 20:03

3 Answers3

24

Yes, brew uninstall ruby should do the trick.

For more info, you can type man brew in your terminal.

Ylan S
  • 1,756
  • 16
  • 9
6

Doing brew uninstall ruby will work. If you really want to be sure, you can run brew cleanup after running the first command. Homebrew just removes unnecessary packages with the brew cleanup command. In some cases, the last command is necessary for the formula to be completely gone. (An example is with the tree formula, I had to use brew cleanup for it to be entirely uninstalled.)

(I know this is late but this can apply to anyone who is viewing this)

ShrubtheBub
  • 126
  • 2
  • 5
  • It won't work because of the updated security Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system. – Edhar Khimich Feb 24 '21 at 20:52
1

This might help other people who used rbenv to manage their ruby versions & have installed rbenv using the command below

brew install rbenv ruby-build

You can uninstall ruby by

brew uninstall rbenv && brew uninstall ruby-build

You can refer to the Installing Ruby section of this guide.

Lea Tinoso
  • 1,663
  • 2
  • 6
  • 14