Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have installed the rubygem application (version 1.3.6) on a Debian system by downloading the rubygems tar.gz archive and running the setup.rb command.

What is the best way to uninstall this application?

share|improve this question

In future, if you have to install from tar.gz files, it's worth using the excellent "checkinstall" program, you just preceded the install command (whatever that might be) with "checkinstall", which will create a deb package and then install it.

You might be able to reinstall rubygems now using checkinstall and then remove it immediately afterwards with dpkg -r packagename.

share|improve this answer

Here's what I did to remove rubygems installed from .tar.gz on a Ubuntu system:

aptitude install checkinstall
tar xfvz rubygems-1.3.6.tgz
cd rubygems-1.3.6
checkinstall ruby setup.rb

When asked, give it a name 'rubygems'. At this moment we have reinstalled the rubygems. Now we need to uninstall it:

dpkg -r rubygems
rm /usr/bin/gem1.8

And that's it. Clean uninstall of rubygems.

Btw: it's recommended to uninstall all gems prior to this, by doing gem uninstall <gem-name> on each gem.

share|improve this answer

Do you mean a specific gem like haml or something, or do you mean the whole gem management system?

To uninstall a gem:

gem uninstall NAME_OF_THE_GEM 

Use sudo if you are not root.

To uninstall ruby gems management system:

You have to options: 1) if you used REE - then jsut wipe REE folder and reinstall that same version again. By default REE is installed in /opt/ruby-enterprise-version-number/

2) if you used stock ruby (apt-get) then it's a little more complicated: Find where ruby is environment sitting:

ruby -e 'puts $:'

Should be something like /usr/local/lib/ruby

change to the directory that has lib/site_ruby/1.8 in it. Based on you environment that could vary.

rm -r rubygems.rb ubygems.rb rubygems

Also remove gem executable.

which gem

Will tell you where executable for gem is sitting By default it should be in: /usr/local/bin/gem & /usr/bin/gem1.8 - just rm -rf on this two items and you are good to go. In the future thou, I highly suggest you use: either Ruby Enterprise Edition ( - it's GPL, free, and has very good and stable reputation - also runs great with Passenger, if you need to deploy rails apps or use apt-get or aptitude.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.