Can I unpack ruby like a gem?

R

Ray K.

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
 
J

John Barnette

Hi,

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. :) 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.
 
B

Brian Candler

Ray said:
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.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top