Ruby install locations, or “Removing Ruby from OS X”

This is a info post for people having problems. Generally Ruby is great, but due to some old development I was doing, my gems got screwed up. The best way to fix this for me meant reinstalling OS X Leopard. This might have come from different package managers running at the same time, like Fink and MacPorts, but ultimately, I had to clean things up.

In addition to a fresh install, I also had to manually remove Ruby from seven locations on my hard drive. They are

  • /sw/lib
  • /usr/lib
  • /Library
  • /opt/local/lib
  • /System/Library/Frameworks/Ruby.framework
  • /opt/local/var/macports/sources/rsync.macports.org/release/ports/
  • /sw/fink

Now that this is done, I’m going to reinstall by

  1. installing MacPorts from their download site
  2. installing Ruby via MacPorts (“sudo port install ruby”)
  3. installing a tar of rubygems and install manually

Likely queries to end up at this page are:

  • How do I remove Ruby from OSX
  • How do I remove Ruby from OS X
  • Reinstalling Ruby
  • Reinstalling Ruby Gems
  • Gems screwed up

Listing Ruby Gems, or just viewing documentation

Here’s a neat trick, if you’re working with Ruby. Ever wondered how to get a list of all installed gems?

At the command prompt, type

sudo gem server

Once you’ve done this, go to http://localhost:8808, and you can see all the Ruby Gems installed, along with info and documentation about them. Awesome!

Hat tip to Matt