Question

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.

Was it helpful?

Solution

I believe everything for MacRuby is installed into /Library/Frameworks/MacRuby.framework. While I haven't tried it myself, removing that directory should remove MacRuby from the system.

MacRuby shouldn't interact with RubyCocoa in such a way as to cause it to stop working. It maybe the case that something else on your system changed at about the same time as the MacRuby install.

OTHER TIPS

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.

Dj2 is right, to uninstall MacRuby:

$ rm -rf /Library/Frameworks/MacRuby.framework
$ rm /usr/local/bin/mac*
$ rm /usr/local/bin/hotcocoa

However, MacRuby and RubyCocoa can live side by side in perfect harmony ;)

This is from Matt Aimonetti's "MacRuby: The Definitive Guide" (O'Reilly):

"MacRuby does not come with an uninstaller. If you want to remove MacRuby from your computer, delete the MacRuby binary files, which use the mac prefix and are located in /usr/local/bin/. Then remove MacRuby itself: /Library/Frameworks/MacRuby.framework."

http://ofps.oreilly.com/titles/9781449380373/index.html

There is a gist to do the whole uninstall: https://gist.github.com/Watson1978/1927952 and it works very nicely!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top