Ruby 1.9 and gems

L

Leslie Viljoen

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
 
J

Jeremy Kemper

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
 
D

David Masover

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

Eric Hodel

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.)
 
J

Jeremy Kemper

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
 
L

Leslie Viljoen

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
 
L

Leslie Viljoen

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
 
L

Leslie Viljoen

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

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,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top