1.8 and 1.9 on arch linux

M

Martin DeMello

Anyone on arch linux? I'm trying to get ruby 1.8 and 1.9 playing
nicely together so that I can easily switch the default "ruby" and
have everything else (rake, irb, rdoc etc) adjust itself accordingly,
ideally without subverting the package manager too much.

martin
 
S

Saji N. Hameed

yes - me!

saji

* Martin DeMello said:
Anyone on arch linux? I'm trying to get ruby 1.8 and 1.9 playing
nicely together so that I can easily switch the default "ruby" and
have everything else (rake, irb, rdoc etc) adjust itself accordingly,
ideally without subverting the package manager too much.

martin

--
Saji N. Hameed

APEC Climate Center
1463 U-dong, Haeundae-gu, +82 51 745 3951
BUSAN 612-020, KOREA (e-mail address removed)
Fax: +82-51-745-3999
 
S

Saji N. Hameed

yes - me!

sorry, my reply was incomplete... in my case, i just compiled 1.9 separately
in a separate directory without using the package manager, and aliased
the 1.9 version using ruby19 and irb19. In case of 1.9, gems get installed
under the 1.9 installation root without disturbing the main ruby installation.
So I guess rake, rdoc etc should work fine if you use either one (1.8 or 1.9)

i don't know if my answer helps much... :)

saji
saji



--
Saji N. Hameed

APEC Climate Center
1463 U-dong, Haeundae-gu, +82 51 745 3951
BUSAN 612-020, KOREA (e-mail address removed)
Fax: +82-51-745-3999

--
Saji N. Hameed

APEC Climate Center
1463 U-dong, Haeundae-gu, +82 51 745 3951
BUSAN 612-020, KOREA (e-mail address removed)
Fax: +82-51-745-3999
 
M

Martin DeMello

sorry, my reply was incomplete... in my case, i just compiled 1.9 separately
in a separate directory without using the package manager, and aliased
the 1.9 version using ruby19 and irb19. In case of 1.9, gems get installed
under the 1.9 installation root without disturbing the main ruby installation.
So I guess rake, rdoc etc should work fine if you use either one (1.8 or 1.9)

i don't know if my answer helps much... :)

I have that much working already :) What I want to do is have the
default ruby switch between 1.8 and 1.9 when I run a command - right
now I run 1.8 as 'ruby' and 1.9 as ruby-1.9. I hacked something up by
manually renaming ruby to ruby-1.8 and adding symlinks, but I was
hoping there was some sort of standard way to do it.

martin
 
A

Alex Eiras

[Note: parts of this message were removed to make it a legal post.]
I have that much working already :) What I want to do is have the
default ruby switch between 1.8 and 1.9 when I run a command - right
now I run 1.8 as 'ruby' and 1.9 as ruby-1.9. I hacked something up by
manually renaming ruby to ruby-1.8 and adding symlinks, but I was
hoping there was some sort of standard way to do it.

martin

If you are using a Debian based system, you may want to take a look at
update-alternatives: it maintains symbolic links determining default
commands (aka. Debian alternatives system)

Cheers
Alex
 
P

Pablo Digonzelli

Saji N. Hameed escribió:
sorry, my reply was incomplete... in my case, i just compiled 1.9 separately
in a separate directory without using the package manager, and aliased
the 1.9 version using ruby19 and irb19. In case of 1.9, gems get installed
under the 1.9 installation root without disturbing the main ruby installation.
So I guess rake, rdoc etc should work fine if you use either one (1.8 or 1.9)

i don't know if my answer helps much... :)

saji


--
Pablo R. Digonzelli
Socio Gerente
Software Solutions
IP Soluciones
25 de Mayo 521
San Miguel de Tucuman
0381 4304441
 
I

Igor Pirnovar

Implement something like the following:

#!/bin/bash

if [ $# -eq 0 ]; then
version=9
else
case $1 in
-h|-H) echo "usage: $(basename $0) -8|-9 | [-h]"; exit;;
8|-8) version=8;;
9|-9) version=9;;
*) echo Illegal argument; exit;;
esac
fi

if [ $version = 9 ] ;then
echo Currently your ruby version is 1.9
rm /usr/bin/ruby
ln -s /usr/bin/ruby1.9 /usr/bin/ruby
rm /usr/bin/irb
ln -s /usr/bin/irb1.9 /usr/bin/irb
else
echo Currently your ruby version is 1.8
rm /usr/bin/ruby
ln -s /usr/bin/ruby1.8 /usr/bin/ruby
rm /usr/bin/irb
ln -s /usr/bin/irb1.8 /usr/bin/irb
fi
 
I

Igor Pirnovar

#!/bin/bash

if [ $# -eq 0 ]; then
version=9
else
case $1 in
-h|-H) echo "usage: $(basename $0) -8|-9 | [-h]"; exit;;
8|-8) version=8;;
9|-9) version=9;;
*) echo Illegal argument; exit;;
esac
fi

if [ $version = 9 ] ;then
echo Currently your ruby version is 1.9
rm /usr/bin/ruby
ln -s $(which ruby1.9) /usr/bin/ruby
rm /usr/bin/irb
ln -s $(which irb1.9) /usr/bin/irb
else
echo Currently your ruby version is 1.8
rm /usr/bin/ruby
ln -s $(which ruby1.8) /usr/bin/ruby
rm /usr/bin/irb
ln -s $(which irb1.8) /usr/bin/irb
fi

If you installed all versions of your ruby in standard places or if your
path is pointing to them as it should, the above code is more
appropriate.
 
D

Daniel DeLorme

Martin said:
I have that much working already :) What I want to do is have the
default ruby switch between 1.8 and 1.9 when I run a command - right
now I run 1.8 as 'ruby' and 1.9 as ruby-1.9. I hacked something up by
manually renaming ruby to ruby-1.8 and adding symlinks, but I was
hoping there was some sort of standard way to do it.

I'm not sure if it's going to help, but what I did was compile ruby1.8
and 1.9 in separate directories (/opt/ruby/1.8 and /opt/ruby/1.9) and
then prepend either /opt/ruby/1.8/bin or /opt/ruby/1.9/bin to the $PATH
depending on which version I want to use.

Daniel
 

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

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top