Uninstalling Gems

I need to get rid of some ruby gems to standardize my development environment before I begin creating my production environment on Slicehost.  I ignored gems when I first started working with Rails and just followed the given setup instructions, but now it is time to dig in.

My Macbook Pro had a pre-existing Rails environment.  Thus, I have tons of pre-existing ruby gems I want to get rid of first. However, when I do the following:

gem uninstall geokit

I get the following:

ERROR:  While executing gem … (Gem::InstallError)
Unknown gem geokit >= 0

To get around this, I needed to get the install directory for this gem and then specify it when uninstalling:

gem list -d geokit

*** LOCAL GEMS ***

geokit (1.4.1)
Author: Andre Lewis
Rubyforge: http://rubyforge.org/projects/geokit
Installed at: /Users/JRagan/.gem/ruby/1.8

Geokit provides geocoding and distance calculation in an easy-to-use
API

I then specified the actual path to uninstall it:

gem uninstall –install-dir /Users/JRagan/.gem/ruby/1.8 geokit

Successfully uninstalled geokit-1.4.1

Happy day!

I found this and well as a number of useful gem cheats at http://cheat.errtheblog.com/s/gem/

Advertisements

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