Can I unpack ruby like a gem?

Here’s what I like about gems, I can have multiple versions installed
parallel and on top of that I can unpack them into vendor/.

Why can’t I do that with the ruby versions. I have projects using 1.8 as
well as some using 1.9 on my development machine as well as on my
server. I don’t have the time to bring all 1.8s up to 1.9, besides they
run fine as they are now. And using both versions under ubuntu is a lot
of work.

I really like gem for breaking the staleness of package managers and
being easy to use on all operating systems, but why isn’t ruby just a
gem?

Any thoughts on this?

Tick

Hi,

On Oct 13, 2009, at 3:31 PM, Ray K. wrote:

Here’s what I like about gems, I can have multiple versions installed
parallel and on top of that I can unpack them into vendor/.


I really like gem for breaking the staleness of package managers and
being easy to use on all operating systems, but why isn’t ruby just a
gem?

You are creating a bit of a chicken/egg problem here. :slight_smile: That said,
take a look at ZenTest’s multiruby (with a testing focus) or rvm (for
more of a Big Global Ruby Version Switch approach).

~ j.

Ray K. wrote:

And using both versions under ubuntu is a lot
of work.

There are ruby1.8 and ruby1.9 packages, so I’d have thought it would be
OK, although the ruby1.9 package is likely stale.

One option is for you to install the default ruby(1.8) from apt, and
then build 1.9 from source:

./configure --program-suffix=19

then you will get /usr/local/bin/ruby19, /usr/local/bin/irb19 etc which
won’t conflict.

What I tend to do is just install multiple versions of ruby from source,
in which case you’ll get exactly which versions of 1.8.x and 1.9.x that
you want.

Admittedly, it can get messy if you want 1.8.6 and 1.8.7 side by side,
because they share the same lib dir and gems. If you want them to be
absolutely 100% independent, then do

./configure --prefix=/opt/ruby187p174

and then symlink /opt/ruby187/bin/ruby to wherever you want to invoke it
from (say /usr/bin/ruby18). The advantage of this is that you can do

rm -rf /opt/ruby187p174

to get rid of that installation of ruby entirely, and a symlink update
will allow you to switch forward and backward between different versions
instantly.

Regards,

Brian.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs