[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

1.8 and 1.9 on arch linux

Martin DeMello

4/20/2009 2:39:00 AM

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

8 Answers

Saji N. Hameed

4/20/2009 2:41:00 AM

0

yes - me!

saji

* Martin DeMello <martindemello@gmail.com> [2009-04-20 11:39:05 +0900]:

> 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 saji@apcc21.net
Fax: +82-51-745-3999




Saji N. Hameed

4/20/2009 2:48:00 AM

0


> 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
>
> * Martin DeMello <martindemello@gmail.com> [2009-04-20 11:39:05 +0900]:
>
> > 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 saji@apcc21.net
> Fax: +82-51-745-3999
>
>
>
>
>

--
Saji N. Hameed

APEC Climate Center
1463 U-dong, Haeundae-gu, +82 51 745 3951
BUSAN 612-020, KOREA saji@apcc21.net
Fax: +82-51-745-3999




Martin DeMello

4/20/2009 3:02:00 AM

0

On Mon, Apr 20, 2009 at 8:17 AM, Saji N. Hameed <saji@apcc21.net> wrote:
>
>> 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... :)

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

Alex Eiras

4/20/2009 8:23:00 AM

0

[Note: parts of this message were removed to make it a legal post.]

> On Mon, Apr 20, 2009 at 8:17 AM, Saji N. Hameed <saji@apcc21.net> wrote:
> >
> >> 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... :)
>
> 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

Pablo Digonzelli

4/20/2009 3:51:00 PM

0

Saji N. Hameed escribió:
>> 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
>>
>> * Martin DeMello <martindemello@gmail.com> [2009-04-20 11:39:05 +0900]:
>>
>>
>>> 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 saji@apcc21.net
>> Fax: +82-51-745-3999
>>
>>
>>
>>
>>
>>
>
>


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



Igor Pirnovar

4/20/2009 5:34:00 PM

0

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


--
Posted via http://www.ruby-....

Igor Pirnovar

4/20/2009 6:07:00 PM

0

#!/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.
--
Posted via http://www.ruby-....

Daniel DeLorme

4/20/2009 10:51:00 PM

0

Martin DeMello wrote:
> On Mon, Apr 20, 2009 at 8:17 AM, Saji N. Hameed <saji@apcc21.net> wrote:
>>> 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... :)
>
> 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