[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby 1.9 and gems

Leslie Viljoen

6/7/2008 9:36:00 PM

Hi!

I'd like to try Ruby1.9 on some of my projects but I'm not sure how it
gels with the existing
Ruby install. How do I install gems for 1.9? Do most of the gems even
work under 1.9?
Specifically, I need ActionPack.

Les

9 Answers

Jeremy Kemper

6/7/2008 9:46:00 PM

0

On Sat, Jun 7, 2008 at 2:35 PM, Leslie Viljoen <leslieviljoen@gmail.com> wrote:
> I'd like to try Ruby1.9 on some of my projects but I'm not sure how it
> gels with the existing
> Ruby install. How do I install gems for 1.9? Do most of the gems even
> work under 1.9?
> Specifically, I need ActionPack.

It can live alongside your 1.8 install. Configure with a program
suffix so the ruby executables are easily distinguished. For example,
/configure --program-suffix=1.9 will result in ruby1.9, irb1.9,
gem1.9 (RubyGems is bundled with 1.9)

make and install then `gem1.9 install whatever`. Most work fine with
1.9 with minor tweaks. Rails 2.1 is compatible.

Best,
jeremy

David Masover

6/7/2008 9:49:00 PM

0

On Saturday 07 June 2008 16:35:49 Leslie Viljoen wrote:
> Hi!
>
> I'd like to try Ruby1.9 on some of my projects but I'm not sure how it
> gels with the existing
> Ruby install.

Ubuntu installed it as a ruby1.9 command, and gem1.9, etc. In theory, it
should work.

Unfortunately, it does occasionally cause stupidity -- for example, I'll have
rake installed for ruby1.9, and a rake task will end up calling ruby1.9 by
name, as part of trying to install a ruby1.8 gem (doesn't work, needless to
say).

I suspect that there's a way to get them to cooperate short of virtualization,
though.

> Do most of the gems even
> work under 1.9?

Most I've tried have worked.

> Specifically, I need ActionPack.

I think someone has made it work. I'm fairly sure it doesn't out of the box.



Eric Hodel

6/8/2008 1:47:00 AM

0

On Jun 7, 2008, at 14:49 PM, David Masover wrote:
> On Saturday 07 June 2008 16:35:49 Leslie Viljoen wrote:
>> Hi!
>>
>> I'd like to try Ruby1.9 on some of my projects but I'm not sure how
>> it
>> gels with the existing
>> Ruby install.
>
> Ubuntu installed it as a ruby1.9 command, and gem1.9, etc. In
> theory, it
> should work.
>
> Unfortunately, it does occasionally cause stupidity -- for example,
> I'll have
> rake installed for ruby1.9, and a rake task will end up calling
> ruby1.9 by
> name, as part of trying to install a ruby1.8 gem (doesn't work,
> needless to
> say).
>
> I suspect that there's a way to get them to cooperate short of
> virtualization,
> though.

Add --format-executable to the install command line. (You can set
this in ~/.gemrc too.)

Jeremy Kemper

6/8/2008 2:53:00 AM

0

On Sat, Jun 7, 2008 at 2:49 PM, David Masover <ninja@slaphack.com> wrote:
>> Specifically, I need ActionPack.
>
> I think someone has made it work. I'm fairly sure it doesn't out of the box.

It works out of the box.

Best,
jeremy

David Masover

6/8/2008 5:17:00 AM

0

On Saturday 07 June 2008 21:53:23 Jeremy Kemper wrote:
> On Sat, Jun 7, 2008 at 2:49 PM, David Masover <ninja@slaphack.com> wrote:
> >> Specifically, I need ActionPack.
> >
> > I think someone has made it work. I'm fairly sure it doesn't out of the
box.
>
> It works out of the box.

Yes, apparently I spoke too soon.

Pre-2.1 did have problems out of the box, though.



Jeremy Kemper

6/8/2008 6:54:00 AM

0

On Sat, Jun 7, 2008 at 10:16 PM, David Masover <ninja@slaphack.com> wrote:
> On Saturday 07 June 2008 21:53:23 Jeremy Kemper wrote:
>> On Sat, Jun 7, 2008 at 2:49 PM, David Masover <ninja@slaphack.com> wrote:
>> >> Specifically, I need ActionPack.
>> >
>> > I think someone has made it work. I'm fairly sure it doesn't out of the
> box.
>>
>> It works out of the box.
>
> Yes, apparently I spoke too soon.
>
> Pre-2.1 did have problems out of the box, though.

Yup. Lots of Enumerable and string encoding changes, plus a fix for
[ruby-core:14716].

jeremy

Leslie Viljoen

6/8/2008 8:08:00 AM

0

I located gem1.9, actually expected it before and missed it.
Playing with IRB1.9, some of the improvements look really interesting!

"".methods returns symbols now. No more crazy string[5] returning an integer!
And the speed, wahooo!

I just can't gdiff's C extension to compile, which is probably because of string
changes. I'll have a go at fixing it.


Les

Leslie Viljoen

6/8/2008 9:00:00 AM

0

On Sun, Jun 8, 2008 at 10:08 AM, Leslie Viljoen <leslieviljoen@gmail.com> wrote:
> I located gem1.9, actually expected it before and missed it.
> Playing with IRB1.9, some of the improvements look really interesting!
>
> "".methods returns symbols now. No more crazy string[5] returning an integer!
> And the speed, wahooo!
>
> I just can't gdiff's C extension to compile, which is probably because of string
> changes. I'll have a go at fixing it.

Ok I fixed the extension but how do I repackage my changes to the gem so
that they can be installed properly? If I fix the source as "gem" suggests and
run "gem install" again, it refetches the old gem and overwrites my changes.

Les

Leslie Viljoen

6/8/2008 9:15:00 AM

0

Nevermind, I got the .tar.bz2 file for the gem, changed it and rebuilt the gem
that way. Seems to work!