2

What is the best way to remove RVM, Ruby, Ruby gem and rails in Ubuntu 12.04?

djd
  • 977
  • 1
  • 6
  • 20
Ganesh Kunwar
  • 2,613
  • 1
  • 17
  • 36
  • 2
    `rvm implode`. Assuming: you installed Ruby using rvm. You installed ruby gems into (any) rvm gemset. – Zabba Jul 18 '12 at 06:16
  • @Ganeshkunwar, I guess you installed ruby using apt-get(not using rvm). So remove ruby from system using `aptitude purge ruby` – Shamith c Jul 18 '12 at 06:50

2 Answers2

3

At first find where ruby is? then

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

Have a try. may it will help.

regmiprem
  • 725
  • 2
  • 13
  • 38
2

You can use rm -rf ~/.rvm to remove RVM. If there is a separate version of ruby installed you'll need to sudo apt-get remove ruby1.x.x depending on the version.

Conner
  • 27,462
  • 8
  • 47
  • 72
  • `rails` is a gem and can be uninstalled with `gem uninstall rails`. – Conner Jul 18 '12 at 05:39
  • rails is removed, but ruby is still not removed. – Ganesh Kunwar Jul 18 '12 at 05:41
  • Type `ruby -v` to see what version of ruby is installed and then use `sudo apt-get remove ruby1.x.x` where 1.x.x is the version. For example if `ruby -v` shows 1.9.2 then do `sudo apt-get remove ruby1.9.2` – Conner Jul 18 '12 at 05:43
  • You can use `dpkg -l | grep ruby` to see the name of the ruby package directly. See here for more help: http://stackoverflow.com/questions/3957730/how-can-i-uninstall-ruby-on-ubuntu – Conner Jul 18 '12 at 06:31