I uninstalled Ruby as I required a newer version. This post will tell you how to do it. This can also be used with other stuff you need to uninstall.
Find out what executable you’re running?
which ruby #You may get /usr/bin/ruby
Find out what it actually?
readlink -f /usr/bin/ruby /usr/bin/ruby1.8
Find out what package it belongs to?
dpkg -S /usr/bin/ruby1.8 ruby1.8: /usr/bin/ruby1.8
sudo apt-get purge ruby1.8 #I got something like this Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: ruby1.8-dev libtcltk-ruby1.8 libreadline5 libruby1.8 Use 'apt-get autoremove' to remove them. The following packages will be REMOVED: gyazo* ri1.8* ruby* ruby-full* ruby1.8* ruby1.8-full* 0 upgraded, 0 newly installed, 6 to remove and 13 not upgraded. After this operation, 11.9 MB disk space will be freed. Do you want to continue [Y/n]? Y (Reading database ... 287401 files and directories currently installed.) Removing gyazo ... Removing ruby-full ... Removing ruby1.8-full ... Removing ri1.8 ... Removing ruby ... Removing ruby1.8 ... update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in auto mode. Purging configuration files for ruby1.8 ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for desktop-file-utils ... Processing triggers for gnome-menus ... Processing triggers for man-db ...
You can check what else it removed and again install it.
WARNING : The version of Ruby in /usr/bin is the system-installed version, and should be left in place.
The version you have in /usr/local/bin can probably be safely removed. If you compiled and installed it manually, you can try removing the binaries from /usr/local/bin, but you may still have gems and other files lying around (most likely in /usr/local/lib/ruby.)