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?
-
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.
-
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
-
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.