How to update ruby to version 1.9.2 on linux platform

I’m very sorry that ask several silly questions.But I’m actually very
new for ruby and linux. So please answer my question
I try to install ruby on Ubuntu with command
apt-get install ruby1.9.1-full
The process is completed.But I cant use ruby command just like
ruby -v
So I try apt-get install ruby It’s work.But when I check
version of ruby It’s 1.8.7. How I upgrade ruby to latest version on
linux ? Please help me

                                                         Very thanks

Hi,

On 23.09.2010 22:57, Tanawat L. wrote:

I’m very sorry that ask several silly questions.But I’m actually very
new for ruby and linux. So please answer my question
I try to install ruby on Ubuntu with command
apt-get install ruby1.9.1-full
The process is completed.But I cant use ruby command just like
ruby -v
So I try apt-get install ruby It’s work.But when I check
version of ruby It’s 1.8.7. How I upgrade ruby to latest version on
linux ? Please help me

ruby1.9.1-full is a convenient package to install everything related to
ruby 1.9.1, thus the real package containing the actual ruby executable
is ruby-1.9.1. The binary itself is called “ruby1.9.1”, so you need to
run

$ ruby1.9.1 yourscript.rb

Ubuntu, like Debian, has a web gateway to all that package information.
If you happen to get lost the next time, you can use it that way:

  1. Search your package at http://packages.ubuntu.com/
  2. E.g. find Ubuntu – Error
  3. Follow to Ubuntu – Error
  4. View the list of files →
    http://packages.ubuntu.com/en/lucid/i386/ruby1.9.1/filelist

Without using the web, you can use

$ dpkg -L

To list the files contained in a package. But that wouldn’t have helped
much with the ruby1.9.1-full package …

HTH

Tanawat L. wrote:

I’m very sorry that ask several silly questions.But I’m actually very
new for ruby and linux. So please answer my question
I try to install ruby on Ubuntu with command
apt-get install ruby1.9.1-full
The process is completed.But I cant use ruby command just like
ruby -v
So I try apt-get install ruby It’s work.But when I check
version of ruby It’s 1.8.7. How I upgrade ruby to latest version on
linux ? Please help me

                                                         Very thanks

A stable Ubuntu release most of the time doesn’t have all the latest
versions of all the software available. So no Ruby 1.9.2 on Ubuntu 10.04
for now.

However there is a testing Ubuntu release available, which should (by
theory, haven’t checked physically) include newer releases, like Ruby
1.9.2. NOT recommended for newbies though, as it includes bugs here and
there.

On 26/09/10 at 00:37 +0900, Markus F. wrote:

On 25.09.2010 15:36, A. Gurbuz wrote:

However there is a testing Ubuntu release available, which should (by
theory, haven’t checked physically) include newer releases, like Ruby
1.9.2. NOT recommended for newbies though, as it includes bugs here and
there.

I’ve a Ubuntu 10.10 which is in Beta. It’s ruby 1.9.1 there, still. And
yes, a few gems requiring compilation don’t work due newer version of
libs etc.

I’m surprised, Ubuntu 10.10 already has ruby 1.9.2. The package is named
ruby1.9.1 since it’s the 1.9.1 is the ruby compatibility version.
See Maverick (10.10) : ruby1.9.1 package : Ubuntu

Are you sure that your system is up-to-date?

  • Lucas

On 25.09.2010 15:36, A. Gurbuz wrote:

However there is a testing Ubuntu release available, which should (by
theory, haven’t checked physically) include newer releases, like Ruby
1.9.2. NOT recommended for newbies though, as it includes bugs here and
there.

I’ve a Ubuntu 10.10 which is in Beta. It’s ruby 1.9.1 there, still. And
yes, a few gems requiring compilation don’t work due newer version of
libs etc.

  • Markus

On 09/23/2010 04:57 PM, Tanawat L. wrote:

I’m very sorry that ask several silly questions.But I’m actually very
new for ruby and linux. So please answer my question
I began writing, and found myself creating a very long and detailed
reply, so I made it a blog post:
by: Brandon, the Random Man: Source Installation of Ruby in Ubuntu
hope it helps!
GB Hoyt

On 25.09.2010 19:33, Lucas N. wrote:

I’m surprised, Ubuntu 10.10 already has ruby 1.9.2. The package is named
ruby1.9.1 since it’s the 1.9.1 is the ruby compatibility version.
See Maverick (10.10) : ruby1.9.1 package : Ubuntu

Are you sure that your system is up-to-date?

You’re right, somehow this doesn’t match. I didn’t install those
packages I was just looking at their apt-cache output:

ruby1.9.1 - Interpreter of object-oriented scripting language Ruby 1.9.2
ruby1.9.1-dev - Header files for compiling extension modules for the
Ruby 1.9.1

I retreat, no idea which was is now the real now.

I don’t use the packages anymore due all the version mismatch, up-2-date
and stuff issues and solely rely on rvm.

sorry,

  • Markus

On 10-09-23 04:57 PM, Tanawat L. wrote:

I’m very sorry that ask several silly questions.But I’m actually very
new for ruby and linux. So please answer my question
I try to install ruby on Ubuntu with command
apt-get install ruby1.9.1-full
The process is completed.But I cant use ruby command just like
ruby -v
So I try apt-get install ruby It’s work.But when I check
version of ruby It’s 1.8.7. How I upgrade ruby to latest version on
linux ? Please help me

you could simply build it from source, it’s not that hard!

step 1) make sure you got everything you need to compile and build

sudo aptitude install build-essential make
sudo aptitude install libc6-dev libssl-dev
sudo aptitude install libreadline6-dev zlib1g-dev

step 2) get the current release ruby1.9.2-p0

wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz

step 3) extract the source files

tar xvzf ruby-1.9.2-p0.tar.gz

step 4) build ruby, these steps will install ruby under
“/usr/local/bin/ruby”

cd ruby-1.9.2-p0/
./configure
make
make test
sudo make install

ruby -v

rubygems is now a part of ruby so you can also type

gem -v

On 09/28/2010 10:36 PM, G Brandon H. wrote:

On 09/23/2010 04:57 PM, Tanawat L. wrote:

I’m very sorry that ask several silly questions.But I’m actually very
new for ruby and linux. So please answer my question
I began writing, and found myself creating a very long and detailed
reply, so I made it a blog post:
by: Brandon, the Random Man: Source Installation of Ruby in Ubuntu
hope it helps!
GB Hoyt

here is a pastie to the script I use for keeping my ruby fresh and
clean!
http://pastie.org/1187982
gb hoyt