# Ruby uninstall and fresh install

**URL:** <https://www.ruby-forum.com/t/ruby-uninstall-and-fresh-install/186451>\
**Category:** Ruby\
**Created:** [April 7, 2010, 12:12pm UTC](https://www.ruby-forum.com/t/ruby-uninstall-and-fresh-install/186451 "2010-04-07T12:12:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shreyas12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@shreyas12](https://www.ruby-forum.com/u/shreyas12)\
**Post date:** [April 7, 2010, 12:12pm UTC](https://www.ruby-forum.com/t/ruby-uninstall-and-fresh-install/186451/1 "2010-04-07T12:12:23Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![shreyas12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@shreyas12](https://www.ruby-forum.com/u/shreyas12)\
**Post date:** [April 7, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/ruby-uninstall-and-fresh-install/186451/2 "2010-04-07T13:30:29Z")

</div>

Shreyas S. wrote:

> when we try “which ruby” it points to /usr/local.

In some shells, “rehash” will do what you want, but otherwise just  
logout and login again.

> and also any idea how we can uninstall ruby from /usr/local.

Just remove the files. For example, use

ls -lrt /usr/local/bin

to see which files were installed in that directory with the same  
timestamp and are probably parts of ruby, then delete them: e.g.

rm /usr/local/bin/{ruby,erb,irb,testrb}

Then check under the rest of /usr/local:

ls -lrtR /usr/local

Probably you will need:

rm -rf /usr/local/lib/ruby

rm -rf /usr/local/lib/libruby\*

Maybe a few stragglers in /usr/local/man, /usr/local/share/doc etc
