eKek0
eKek0

Reputation: 23319

How to update ruby on linux (ubuntu)?

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?

Upvotes: 48

Views: 185221

Answers (9)

user7542
user7542

Reputation: 111

Ruby is v2.0 now. Programs like Jekyll (and I am sure many others) require it. I just ran:

sudo apt-get install ruby2.0

check version

ruby --version

Hope that helps

Upvotes: 11

Chris
Chris

Reputation: 399

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

Upvotes: 37

Zorayr
Zorayr

Reputation: 24962

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

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

Upvotes: 16

ucefkh
ucefkh

Reputation: 2531

If you are like me using ubuntu 10.10 & cant find the lastest version which is now

  • ruby1.9.3

this is where you can get it http://www.ubuntuupdates.org/package/brightbox_ruby_ng_experimental/maverick/main/base/ruby1.9.3

or download the *.deb file :)

& remember that it wont alter you old version of ruby

Upvotes: 1

Konrad Reiche
Konrad Reiche

Reputation: 29543

The author of this article claims that it would be best to avoid installing Ruby from the local packet manager, but to use RVM instead.

You can easily switch between different Ruby versions:

rvm use 1.9.3

etc.

Upvotes: 9

kenobi
kenobi

Reputation: 41

the above is not bad, however its kinda different for 11.10

sudo apt-get install ruby1.9 rubygems1.9

that will install ruby 1.9

when linking, you just use ls /usr/bin | grep ruby it should output ruby1.9.1

so then you sudo ln -sf /usr/bin/ruby1.9.1 /usr/bin/ruby and your off to the races.

Upvotes: 4

mikewilliamson
mikewilliamson

Reputation: 24803

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.

Upvotes: 0

Ronald Pottol
Ronald Pottol

Reputation: 131

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.

Upvotes: 1

Mark Rushakoff
Mark Rushakoff

Reputation: 258418

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.

Upvotes: 57

Related Questions