Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall Ruby from /usr/local?

Everything was working fine , until we decided to upgrade ruby to 1.8.7 from 1.8.6, and thats when all hell broke loose. When we compiled Ruby 1.8.7 from source it got installed into /usr/local/bin and Ruby 1.8.6 stayed in /usr/bin. Currently, we've uninstalled ruby 1.8.6 and by some stroke we deleted the ruby 1.8.7 files from /usr/local.

when we try "which ruby" it points to /usr/local. If anybody could help us out what we need to do get back on track , we would be very grateful.and also any idea how we can uninstall ruby from /usr/local. we tried yum remove ruby , which removed ruby from /usr/bin.Thanks and Cheers !

like image 807
Shreyas Avatar asked Apr 07 '10 10:04

Shreyas


People also ask

How do I completely remove Ruby from my Mac?

Uninstall Ruby on Mac with rbenv For rbenv, use rbenv versions to see which versions you have installed. Use the uninstall command to remove a version. This will remove any gems associated with the version as well. If you want to reinstall Ruby, see Install Ruby on Mac for recommendations of newer version managers.


1 Answers

Edit: As suggested in comments. This solution is for Linux OS. That too if you have installed ruby manually from package-manager.

If you want to have multiple ruby versions, better to have RVM. In that case you don't need to remove ruby older version.

Still if want to remove then follow the steps below:

First you should find where Ruby is:

whereis ruby 

will list all the places where it exists on your system, then you can remove all them explicitly. Or you can use something like this:

rm -rf /usr/local/lib/ruby rm -rf /usr/lib/ruby rm -f /usr/local/bin/ruby rm -f /usr/bin/ruby rm -f /usr/local/bin/irb rm -f /usr/bin/irb rm -f /usr/local/bin/gem rm -f /usr/bin/gem 
like image 50
Mukesh Singh Rathaur Avatar answered Oct 04 '22 17:10

Mukesh Singh Rathaur