Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Running Multiple Versions of Ruby on Debian?

Reply
Thread Tools

Running Multiple Versions of Ruby on Debian?

 
 
John Griffiths
Guest
Posts: n/a
 
      10-10-2008
Well so far things are going kind of good, I've built my own server and
it's sitting in colo running Debian Etch and Ruby 1.8.6 (built from
source)

Now me being me I wouldn't mind running 1.8.7 alongside 1.8.6 for my
Rails blogging software.

Has anyone had any experiences in running multiple versions of Ruby on
Debian Etch?

I found one article which explains how to run 3 using
update-alternatives but pretty unsure if it'll adapt well to Debian,

http://blog.michaelgreenly.com/2008/...-ubuntu-2.html

Seems possible, especially using:

./configure --prefix=/opt/ruby-1.8.7-p71

To set where to install the Ruby version, I'm imagining I'd have to run
gem --update like,

/opt/ruby-1.8.7-p71/bin/gem --update
or
/opt/ruby-1.8.7-p71/bin/gem install rails

to install the necessary gems per ruby install without touching the one
in /usr/bin/ruby,

then i'm imagining,

/opt/ruby-1.8.7-p71/bin/thin start -C /var/www/apps/myapp/thin.conf
...to start the thin webserver with my config file

Will try out on a virtual machine first, but am i on the right track or
is there something better?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Stefano Crocco
Guest
Posts: n/a
 
      10-10-2008
Alle Friday 10 October 2008, John Griffiths ha scritto:
> Well so far things are going kind of good, I've built my own server and
> it's sitting in colo running Debian Etch and Ruby 1.8.6 (built from
> source)
>
> Now me being me I wouldn't mind running 1.8.7 alongside 1.8.6 for my
> Rails blogging software.
>
> Has anyone had any experiences in running multiple versions of Ruby on
> Debian Etch?
>
> I found one article which explains how to run 3 using
> update-alternatives but pretty unsure if it'll adapt well to Debian,
>
> http://blog.michaelgreenly.com/2008/...uby-on-ubuntu-
>2.html
>
> Seems possible, especially using:
>
> ./configure --prefix=/opt/ruby-1.8.7-p71
>
> To set where to install the Ruby version, I'm imagining I'd have to run
> gem --update like,
>
> /opt/ruby-1.8.7-p71/bin/gem --update
> or
> /opt/ruby-1.8.7-p71/bin/gem install rails
>
> to install the necessary gems per ruby install without touching the one
> in /usr/bin/ruby,
>
> then i'm imagining,
>
> /opt/ruby-1.8.7-p71/bin/thin start -C /var/www/apps/myapp/thin.conf
> ...to start the thin webserver with my config file
>
> Will try out on a virtual machine first, but am i on the right track or
> is there something better?


I'd also suggest to pass configure the --program-prefix or --program-suffix
arguments. This way, you can call the ruby 1.8.7 executable ruby187, instead
of just ruby and you won't have to use its full path every time you want to
use it. The same happens with the other executables, like irb and ri.

Stefano

 
Reply With Quote
 
 
 
 
Hassan Schroeder
Guest
Posts: n/a
 
      10-10-2008
On Fri, Oct 10, 2008 at 9:05 AM, John Griffiths <(E-Mail Removed)> wrote:

> Seems possible, especially using:
>
> ./configure --prefix=/opt/ruby-1.8.7-p71
>
> To set where to install the Ruby version, I'm imagining I'd have to run
> gem --update like,
>
> /opt/ruby-1.8.7-p71/bin/gem --update


> is there something better?


I just create files with appropriate PATH settings, like
------------------------------------------------------------
export RUBY_HOME=/opt/ruby-1.8.7-p71
PATH=$RUBY_HOME/bin:$PATH
------------------------------------------------------------
Name them sensibly, and you can just type, e.g.
prompt% . 187
to source, and voila! No need to enter the entire path, or remember
to use a different name.

FWIW,
--
Hassan Schroeder ------------------------ http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
John Griffiths
Guest
Posts: n/a
 
      10-10-2008
Thanks Stefano,

so if i were to do,

/configure --prefix=/opt/ruby-1.8.7-p71 --program-suffix=187

to make ruby187 point to /opt/ruby-1.8.7-p71/ruby ?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Stefano Crocco
Guest
Posts: n/a
 
      10-10-2008
Alle Friday 10 October 2008, John Griffiths ha scritto:
> Thanks Stefano,
>
> so if i were to do,
>
> ./configure --prefix=/opt/ruby-1.8.7-p71 --program-suffix=187
>
> to make ruby187 point to /opt/ruby-1.8.7-p71/ruby ?


It doesn't create a symlink. It will change the name of the ruby executable:
not

/opt/ruby-1.8.7-p71/ruby

but

/opt/ruby-1.8.7-p71/ruby187

If you then put /opt/ruby-1.8.7-p71 in your PATH, you'll be able to use
ruby187 to call the new version and ruby to call the old version.

Stefano

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Migrating from 1.1 to 3.5 (Multiple Framework Versions running in Parallel) Cowboy \(Gregory A. Beamer\) ASP .Net 2 10-04-2008 02:44 PM
Running Multiple Versions noel@webeok.org Python 0 01-15-2008 09:09 PM
Running multiple versions of Python on the same host.. Cowmix Python 3 07-10-2006 06:04 PM
Running Multiple Versions of an ASP.NET app chooses wrong default =?Utf-8?B?UmljayBMdWJhbm92aWM=?= ASP .Net 0 08-09-2005 04:17 PM
Running Multiple Versions of Instiki on Same Host? Anthony Baker Ruby 2 10-30-2004 11:20 PM



Advertisments