How can I uninstall Ruby on ubuntu?

Ruby on-RailsRubyUbuntuUninstallation

Ruby on-Rails Problem Overview


How can I uninstall Ruby 1.9.2dev (2010-07-02) [i486-linux] on ubuntu? Need to reinstall - please help

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

This command should do the trick (provided that you installed it using a dpkg-based packet manager):

aptitude purge ruby

Solution 2 - Ruby on-Rails

Run the following command from your terminal:

sudo apt-get purge ruby

Usually works well for me.

Solution 3 - Ruby on-Rails

At first find out 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

Solution 4 - Ruby on-Rails

I have tried many include sudo apt-get purge ruby , sudo apt-get remove ruby and sudo aptitude purpe ruby, both with and without '*' at the end. But none of them worked, it's may be I've installed more than one version ruby.

Finally, when I triedsudo apt-get purge ruby1.9(with the version), then it works.

Solution 5 - Ruby on-Rails

Run the following command on the terminal:

sudo apt-get autoremove ruby

Solution 6 - Ruby on-Rails

Here is what sudo apt-get purge ruby* removed relating to GRUB for me:

grub-pc 
grub-gfxpayload-lists
grub2-common
grub-pc-bin 
grub-common 

Solution 7 - Ruby on-Rails

On Lubuntu, I just tried apt-get purge ruby* and as well as removing ruby, it looks like this command tried to remove various things to do with GRUB, which is a bit worrying for next time I want to reboot my computer. I can't yet say if any damage has really been done.

Solution 8 - Ruby on-Rails

If you used rbenv to install it, you can use

rbenv versions 

to see which versions you have installed.

Then, use the uninstall command:

rbenv uninstall [-f|--force] <version>

for example:

rbenv uninstall 2.4.0  # Uninstall Ruby 2.4.0

If you installed Rails, it will be removed, too.

Solution 9 - Ruby on-Rails

Why you are removing old version of the ruby?

>rvm install 2.4.2 // version of ruby u need to insatll >rvm use 2.4.2 --default // set ruby version you want use by default

Using rvm you can install multiple ruby version in the system

Please follow below steps install ruby using rvm

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 
curl -sSL https://get.rvm.io | bash -s stable 
source ~/.rvm/scripts/rvm
rvm install 2.4.2 
rvm use 2.4.2 --default 
ruby -v

The installation step will change for different Ubuntu version

For more info,

https://gorails.com/setup/ubuntu/14.04

Solution 10 - Ruby on-Rails

Uninstall the make install software when make uninstall invalid.

  • make install will create file '.installed.list'
  • Choose to clean up the files described in .installed.list (need to be careful if you have multiple versions)
  • Case: ruby2.4 switch to ruby2.3, thinking directly delete all ruby software, and then re-make install 2.3, see: Ruby # Installation Guide
  • make install -> .installed.list
  • see .installed.list file, delete all install files.

ā€Œ

rm -rf /usr/local/include/ruby-*
rm -rf /usr/local/lib/ruby
rm /usr/local/bin/erb /usr/local/bin/gem /usr/local/bin/irb /usr/local/bin/rdoc /usr/local/bin/ri /usr/local/bin/ruby
rm /usr/local/share/man/man1/erb.1 /usr/local/share/man/man1/irb.1 /usr/local/share/man/man1/ri.1 /usr/local/share/man/man1/ruby.1
rm /usr/local/lib/libruby-static.a
rm -rf /usr/local/lib/pkgconfig/ruby-*
which ruby
pkg-config --list-all|grep ruby

Solution 11 - Ruby on-Rails

You can use sudo apt remove ruby

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkhanhView Question on Stackoverflow
Solution 1 - Ruby on-RailsjwuellerView Answer on Stackoverflow
Solution 2 - Ruby on-RailstheamoebaView Answer on Stackoverflow
Solution 3 - Ruby on-RailsregmipremView Answer on Stackoverflow
Solution 4 - Ruby on-RailsshellbyeView Answer on Stackoverflow
Solution 5 - Ruby on-RailsDDDView Answer on Stackoverflow
Solution 6 - Ruby on-RailsTravisView Answer on Stackoverflow
Solution 7 - Ruby on-RailsAlistairView Answer on Stackoverflow
Solution 8 - Ruby on-RailsAboozar RajabiView Answer on Stackoverflow
Solution 9 - Ruby on-RailsNataraja BView Answer on Stackoverflow
Solution 10 - Ruby on-RailstakeseemView Answer on Stackoverflow
Solution 11 - Ruby on-RailsEmjeyView Answer on Stackoverflow