Does anyone know how to uninstall MacRuby? I was using RubyCocoa then decided to try out MacRuby, after installing MacRuby, RubyCocoa has stopped working. So I would like to remove MacRuby, but I cannot find any documentation on how to uninstall it.
The given answers won't remove everything. You'll still have XCode templates, examples and a few other dangling sym links: to rb_nibtool and the macruby man page.
To clean this up you need the .pkg file used to install MacRuby in the first place. This gives you a list of all files installed which you can delete. I did this:
$ xar -xf macruby_nightly.pkg
$ lsbom macrubynightly.pkg/Bom # not a typo, the above archive contains this folder
It would be nice if there were a better way to do this...
There is an easier way to list files in an installed package:
$ pkgutil --pkgs # list IDs of all installed packages
$ pkgutil --pkgs |grep -i ruby # get all related to ruby
$ pkgutil --files com.apple.macruby.macruby.MacRuby-0.pkg # show all files for MacRuby-0.8
If you delete the files, be sure to remove the receipt, as well (/Library/Receipts):
$ sudo pkgutil --forget com.apple.macruby.macruby.MacRuby-0.pkg
If you don't remove the receipt, you could have trouble reinstalling later (usually only for previous versions of the same package).
You can also delete all the files using pkgutil:
$ sudo pkgutil --unlink com.apple.macruby.macruby.MacRuby-0.pkg
The docs are not great (for me, at least) and I was a little scared to try it - it looked like it wanted to be overly-aggressive in deleting/unlinking things it didn't "own" (e.g., it tried to unlink /usr).
In the end, I made sure that Time Machine was working and ran the command. It deletes all the files and leaves behind all the empty directories. That's dumb, but safe enough. I'm sure someone has written a script to wrap all this up into a single safe operation, but I just cleaned up by hand.
Also, '--unlink' does not imply '--forget', so you also still need to run that after.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With