error in uninstalling Ruby from UBUNTU 14.0.4 LTS

916 views Asked by At

I have made some mistake in installing Ruby and and now I'm trying to uninstall it (How to remove ruby from ubuntu) but it's giving the following error. I tried with sudo apt-get purge ruby but still couldn't uninstall. It shows ruby is not installed but I did check and confirm that it is installed in the location /usr/local/bin/ruby. please help me to uninstall Ruby and RVM from my machine.

$ ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]

$ sudo apt-get purge ruby 1.8.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libhdf5-mpich2-1.8.7' for regex '1.8.7'
Note, selecting 'libhdf5-1.8.7' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-prof-0.0.5.1-87764' for regex '1.8.7'
Note, selecting 'libhdf5-openmpi-1.8.7' for regex '1.8.7'
Note, selecting 'libhdf5-serial-1.8.7' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-dev-0.0.5.1-87764' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-dev' instead of 'libghc-utility-ht-dev-0.0.5.1-87764'
Note, selecting 'libghc-utility-ht-prof' instead of 'libghc-utility-ht-prof-0.0.5.1-87764'
Package 'libhdf5-1.8.7' is not installed, so not removed
Package 'libhdf5-serial-1.8.7' is not installed, so not removed
Package 'libhdf5-mpich2-1.8.7' is not installed, so not removed
Package 'libhdf5-openmpi-1.8.7' is not installed, so not removed
Package 'ruby' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 567 not upgraded.
3

There are 3 answers

0
Nani On BEST ANSWER

I have removed the ruby directory from home directory and followed the below steps...

$ whereis ruby
ruby: /usr/local/bin/ruby /usr/local/lib/ruby

$ ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]

$ sudo rm -rf /usr/local/bin/ruby
$ sudo rm -rf /usr/local/lib/ruby
$ ruby -v
bash: /usr/local/bin/ruby: No such file or directory

finally it got uninstalled !! Thanks to Rick

10
rick On

if you want to remove ruby completely,

sudo apt-get purge ruby rubygems

Or you can follow this steps below,

Use this to find out what it is

$ readlink -f /usr/local/bin/ruby

/usr/local/bin/ruby1.8.7

Use this to find out what package is using:

$ dpkg -S /usr/local/bin/ruby1.8.7
ruby1.8: /usr/local/bin/ruby1.8.7

And use this to install,

$ apt-get purge ruby1.8.7
0
Amit Thawait On

If you are using rvm, then you can uninstall ruby 1.8.7 using the command

rvm unistall 1.8.7

and then you uninstall the rvm using the command

rvm implode