Installing irb in Ubuntu

Hi.

I’ve installed Ubuntu Dapper in my desktop. To my disappoint it doesn’t
have ruby preinstalled. That’s still okay, because I can do it by
myself.

I’ve apt-get install ruby. Then, I’ve apt-get install irb1.8 because
I’ve
installed
ruby1.8. Surprisingly, irb command did not work. It turned out that I
also
have to apt-get install irb to run irb command.

I can’t figure out why things are working in this way. Does it make
sense
to apt-get twice just for irb? Or is this my own problem and not of
ubuntu
packages?

If it’s true that we have to apt-get install irb irb1.8 just for irb
command,
is there any way to fix such a non-intuitive installation procedure?

Sincerely,
Minkoo S.

If it’s true that we have to apt-get install irb irb1.8 just for irb
command,
is there any way to fix such a non-intuitive installation procedure?

I used ubuntu recently and I recall that ruby was split into many
more pieces than I expected libruby1.8, ruby1.8 (interpreter) IIRC so
yeah it’s a different beast from the WinXP one-click-installer

Kev

Minkoo S. wrote:

I can’t figure out why things are working in this way. Does it make sense
to apt-get twice just for irb? Or is this my own problem and not of ubuntu
packages?

I have been blogging more times about ubuntu and Ruby/Rails installation
woes - Ubuntu is absolutely my favorite distro, unfortunately it does
not play very well with Ruby/Rails (and programming stuff in general).

There is not even a preinstalled make - which is IMHO kind of a shame
for a linux distribution. It is one of the few distros i have met, where
you can not install rails easily (e.g. gentoo: emerge rails). Here,
you can not even dream about ‘sudo apt-get install rails’. Also, there
are other packages (e.g. libopenssl-ruby) which you have to install
along the way, sudo apt-get install ruby won’t do it for you.

Conclusion: Ubuntu is a very fine distro for desktop usage, but be
prepared for heavy installation session to fine-tune it for programming
(esp. bleeding edge stuff).

Peter

http://www.rubyrailways.com

On Tue, Jun 20, 2006 at 03:48:32PM +0900, Minkoo S. wrote:

[…]
If it’s true that we have to apt-get install irb irb1.8 just for irb
command,
is there any way to fix such a non-intuitive installation procedure?

Probably irb _depends_ on irb1.8 already, so you (probably) can just

install irb, and it will drag irb1.8 with it. It probably works like in
Debian:

- irb _depends_ on the "default" Ruby version, and provides the 

“irb”
command (just a symbolic link to the default one)
- irb1.8 provides the real irb program, but as “irb1.8”. When the
“irb”
package is installed, /usr/bin/irb already points to irb1.8, so
you can
use “irb” in the command line

On Tuesday 20 June 2006 08:48, Minkoo S. wrote:

I can’t figure out why things are working in this way. Does it make sense
to apt-get twice just for irb? Or is this my own problem and not of ubuntu
packages?

If it’s true that we have to apt-get install irb irb1.8 just for irb
command,
is there any way to fix such a non-intuitive installation procedure?

Sincerely,
Minkoo S.

Actually, you got it completely wrong. Explanation and fix follows.

If you run ‘apt-cache show irb’ and ‘apt-cache show irb1.8’ you’ll see
Ubuntu
Dapper ships with two different Ruby versions: packages ruby, irb, ri,
rdoc,
etc are Ruby 1.8.2 and packages ruby1.8, irb1.8, ri1.8, rdoc1.8, etc are
Ruby
1.8.4. I guess the reason to ship two different versions is some
dependency
problem, but I think that was a very wrong decision.

Therefore, you now have two different irb versions installed: 1.8.2 and
1.8.4
and I’m pretty sure you don’t want that. I guess you want Ruby 1.8.4.
What do
you do?

  1. First of all, remove the 1.8.2 versions (irb, ri, ruby, rdoc, etc).
    You may
    want to use dpkg --print-avail to find out the version
    information for an already-installed package. You may want to use
    dpkg --get-selections to get a full list of packages installed on your
    computer.

  2. Install the 1.8.4 versions (ruby1.8, irb1.8, rdoc1.8, etc). Now
    you’ll
    have /usr/bin/ruby1.8, /usr/bin/irb1.8, etc

  3. Use update-alternatives to install symlinks for easy access:

    update-alternatives --install /usr/bin/irb irb /usr/bin/irb1.8 10

    This is a per-system (not per-user) setting. You might want to take a
    look
    at man update-alternatives to know the meaning of each option and how to
    reconfigure it later.

You can just create symlinks instead of using update-alternatives, but
update-alternatives has some advantages (easy management, automanagement
when
you install a package that provides the the “alternative”, etc).

Debian Testing and Debian Sid have both Ruby 1.8.2 and Ruby 1.8.4, too.

Lastly, some people have said it’s impossible to install rails in
Ubuntu.
That’s not true. There is a ‘rails’ package, it’s up-to-date (1.1.2) and
it’s
in the ‘universe’ repository. You may need to edit your
/etc/apt/sources.list
file.

On Tuesday 20 June 2006 13:00, Jon L. wrote:

No, that will install ruby 1.8.2:

[email protected]:~$ apt-cache show irb | grep Version
Version: 1.8.2-1
[email protected]:~$ apt-cache show ruby | grep Version
Version: 1.8.2-1

You need the *1.8 packages:

[email protected]:~$ apt-cache show ruby1.8 | grep Version
Version: 1.8.4-1ubuntu1
[email protected]:~$ apt-cache show irb1.8 | grep Version
Version: 1.8.4-1ubuntu1

The data in the meta package is wrong.
Therefore, you cannot believe the Version output from apt-cache show.

ruby depends on ruby1.8
irb depends on irb1.8
sic the 1.8.4 versions will be installed and you will not have to
symlink irb.

You just have to turn a blind eye to the metapackage version number.

On Tuesday 20 June 2006 13:13, Jon L. wrote:

Oh yes, you are right. I hadn’t noticed the dependency.

Thank you for the all the comments.

I’m curious why there are two packages for ruby: ruby and ruby1.8.
Is ruby a wrapper for ruby1.8?

I also got an offtopic question. Is there any way to get a list
of installed package using apt-get (or aptitude)? I’m afraid that I
don’t
have
much experience with apt-get.

Sincerely,
Minkoo S.

On 6/22/06, Minkoo S. [email protected] wrote:

Thank you for the all the comments.

I’m curious why there are two packages for ruby: ruby and ruby1.8.
Is ruby a wrapper for ruby1.8?

to the official version, yes. ruby1.9 should be there to.
the idea is, i think to prevent dependency changes in packages that
require ruby. they should not care if its 1.8.4 or 1.9… they
might need to thru.

I also got an offtopic question. Is there any way to get a list
of installed package using apt-get (or aptitude)? I’m afraid that I don’t

dpkg -l ?

IIRC that is was just poor naming on the meta packages.
Dapper does ship with ruby 1.8.4

$ sudo apt-get install irb ruby

will install the 1.8.4 versions

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs