tags:

views:

534

answers:

5

I'm newbie on both ruby and linux, so I'm sure this is trivial but I don't know yet. I currently have ruby 1.8.7 installed and I want to update it to ruby 1.9. How can I do that? Thanks in advanced.

+2  A: 
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.

Mark Rushakoff
A: 

First, which version of ubuntu are you using, it might be easiest to just upgrade to one that has it.

Next, enable backports (system menue, adminstration, software sources), and search for in in synaptic.

Last, look for a ppa for it.

Ronald Pottol
A: 

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-9
sudo ln -sf /usr/bin/ruby1-9 /usr/bin/ruby

That should do it.

oldmanjoyce
A: 

Generally the verions of programs are linked to the version of your operating system. So if you were running gutsy you would either have to upgrade to the new jaunty jackalope version which has ruby 1.9 or add the respoistories for jaunty to your /etc/apt/sources.list file. Once you have done that you can start up the synaptic package manager and you should see it in there.

Mike Williamson
A: 

For anyone interested in installing or upgrading from source to get the latest version, it's super easy. Instructions here:

http://developers.appoxy.com/2010/08/installing-ruby-19-from-source-on.html

Travis R