Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall MacRuby

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.

like image 329
Kaom Te Avatar asked Jul 18 '09 04:07

Kaom Te


2 Answers

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...

like image 125
Charles Dale Avatar answered Nov 06 '22 10:11

Charles Dale


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.

like image 41
Erick Avatar answered Nov 06 '22 09:11

Erick