How to uninstall / remove Ruby Gems (on Ubuntu)?
First we need to find out the exact location that the Ruby installs it’s libraries. In the terminal program, You can type the following command to find out the exact location.
You’ll get list of paths. This is the output that I got in my machine.
Next we need to change our directory in to /usr/local/lib/site_ruby/1.8 and type following command to list the files.
Now we are ready to remove the gems. Type,
If you wish to remove all gems installed in your computer, first find out the location by executing following commands
Next you can remove them by using following commands. That’s it!
ruby -e 'puts $:'
/usr/local/lib/site_ruby/1.8
/usr/local/lib/site_ruby/1.8/i486-linux
/usr/local/lib/site_ruby/1.8/i386-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/vendor_ruby/1.8
/usr/lib/ruby/vendor_ruby/1.8/i486-linux
/usr/lib/ruby/vendor_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/i486-linux
/usr/lib/ruby/1.8/i386-linux
.
/usr/local/lib/site_ruby/1.8/i486-linux
/usr/local/lib/site_ruby/1.8/i386-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/vendor_ruby/1.8
/usr/lib/ruby/vendor_ruby/1.8/i486-linux
/usr/lib/ruby/vendor_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/i486-linux
/usr/lib/ruby/1.8/i386-linux
.
ls -la
drwxr-xr-x 5 root root 4096 2009-07-15 12:15 .
drwxr-xr-x 3 root root 4096 2009-07-15 12:14 ..
-rw-r--r-- 1 root root 1415 2009-07-15 12:15 gauntlet_rubygems.rb
drwxrwsr-x 2 root staff 4096 2009-07-15 12:14 i486-linux
drwxr-xr-x 2 root root 4096 2009-07-15 12:15 rbconfig
drwxr-xr-x 6 root root 4096 2009-07-15 12:15 rubygems
-rw-r--r-- 1 root root 29116 2009-07-15 12:15 rubygems.rb
-rw-r--r-- 1 root root 268 2009-07-15 12:15 ubygems.rb
drwxr-xr-x 3 root root 4096 2009-07-15 12:14 ..
-rw-r--r-- 1 root root 1415 2009-07-15 12:15 gauntlet_rubygems.rb
drwxrwsr-x 2 root staff 4096 2009-07-15 12:14 i486-linux
drwxr-xr-x 2 root root 4096 2009-07-15 12:15 rbconfig
drwxr-xr-x 6 root root 4096 2009-07-15 12:15 rubygems
-rw-r--r-- 1 root root 29116 2009-07-15 12:15 rubygems.rb
-rw-r--r-- 1 root root 268 2009-07-15 12:15 ubygems.rb
rm -r rubygems.rb ubygems.rb rubygems
which gem gem1.8
rm -r /usr/local/bin/gem
rm -r /usr/bin/gem1.8
rm -r /usr/bin/gem1.8
This entry was posted in Web Development and tagged Gem, How to, Ruby, Ruby on Rails, rubygems, Web Development. Bookmark the permalink.

Pingback: [reproduced] in Linux gem unloading