How to update ruby to version 1.9.2 on linux platform

T

Tanawat Limungkura

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
 
M

Markus Fischer

Hi,

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 http://packages.ubuntu.com/en/lucid/ruby1.9.1-full
3. Follow to http://packages.ubuntu.com/en/lucid/ruby1.9.1
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 <packagename>

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

HTH
 
A

A. Gurbuz

Tanawat said:
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.
 
M

Markus Fischer

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
 
M

Markus Fischer

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 https://launchpad.net/ubuntu/maverick/+source/ruby1.9.1

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
 
R

Rajinder Yadav

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top