Ruby Removal

Ok, you have been using a manually installed custom version of Ruby and find that you need to remove it from your system either because you are done with it or because you are switching to a package manager to handle the tedious task of package installing and dependency tracking.

Removing is not usually a difficult task if you have kept your source and there is an uninstall script in the makefile. Ruby, however, does not bless us with this.

Removing all of the files associated with the application is important since package managers use the files to indicate whether dependencies should be installed.  If you don’t clean up completely, the package manager may not install the dependencies when you reinstall.

So, how do you remove Ruby from your system? To start with, one must remember that in Unix, /usr/local is the “safe haven” for all customization done to the system. This means that when you do updates to the OS, /usr/local will be protected. This is good to know since this is exactly where Ruby gets installed. Don’t touch the Ruby that is installed with the OS.

To remove Ruby from /usr/local
============================================
sudo rm -rf /usr/local/lib/ruby
sudo rm /usr/local/bin/ruby
sudo rm /usr/local/bin/ri
sudo rm /usr/local/bin/irb
sudo rm /usr/local/bin/erb
sudo rm /usr/local/bin/rake
sudo rm /usr/local/bin/gem
sudo rm /usr/local/include/ruby-1.9.1
sudo rm /usr/local/lib/libruby-static.a
sudo rm /usr/local/lib/pkgconfig/ruby-1.9.pc
sudo rm /usr/local/share/man/man1/ruby.1
sudo rm /usr/local/share/man/man1/ri.1
sudo rm /usr/local/share/man/man1/rake.1
sudo rm /usr/local/share/man/man1/irb.1
sudo rm /usr/local/share/man/man1/erb.1
sudo rm /usr/local/share/ri/1.9.1

You should replace the versions in the above paths with the version you are removing.

No touching the files in “/System/Library/Frameworks/Ruby.framework”!  These are the OS installed Ruby files.  Removing these may cause system instability.

Be careful out there,
Dwain

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Ruby Removal

  1. Rob says:

    Thanks Very much!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s