How can I uninstall Ruby on ubuntu?

Solution 1:

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

aptitude purge ruby

Solution 2:

Run the following command from your terminal:

sudo apt-get purge ruby

Usually works well for me.

Solution 3:

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