How to update ruby on linux (ubuntu)? How to update ruby on linux (ubuntu)? ruby ruby

How to update ruby on linux (ubuntu)?


sudo apt-get install ruby1.9

should do the trick.

You can find what libraries are available to install by

apt-cache search <your search term>

So I just did apt-cache search ruby | grep 9 to find it.

You'll probably need to invoke the new Ruby as ruby1.9, because Ubuntu will probably default to 1.8 if you just type ruby.


There's really no reason to remove ruby1-8, unless someone else knows better. Execute the commands below to install 1.9 and then link ruby to point to the new version.

sudo apt-get install ruby1-9 rubygems1-9sudo ln -sf /usr/bin/ruby1-9 /usr/bin/ruby


On Ubuntu 12.04 (Precise Pangolin), I got this working with the following command:

sudo apt-get install ruby1.9.1sudo apt-get install ruby1.9.3