Running Rails 2 and Rails 3 side by side on Ubuntu

Is it possible, to run both versions side by side on the same ubuntu
10.04, or do I have to expect difficulties?

On 22 December 2010 16:31, Fritz T. [email protected] wrote:

Is it possible, to run both versions side by side on the same ubuntu
10.04, or do I have to expect difficulties?

No problem provided you use rvm

Colin

Colin L. wrote in post #970077:

On 22 December 2010 16:31, Fritz T. [email protected] wrote:

Is it possible, to run both versions side by side on the same ubuntu
10.04, or do I have to expect difficulties?

No problem provided you use rvm

Colin

Maybe ‘rvm’ is not a critical requirement for this (?)

I think the requirement is to have:

  • either the different versions of the gems installed
  • or to vendor the rails versions

Without using rvm (just the 1.8.7 system ruby of Ubuntu 10.04),
I was trivially able to run 3.0.3 and 2.3.2 (Uh) in parallel …

[email protected]:~/ra/apps/trials$ rails 2.3.2 rails_2_3_x
create
create app/controllers

[email protected]:~/ra/apps/trials$ rails new rails_3_0_x
create
create README

[email protected]:~/ra/apps/trials$ ls -l | egrep ‘rails_’
drwxr-xr-x 13 peterv peterv 4096 2010-12-22 22:42 rails_2_3_x
drwxr-xr-x 13 peterv peterv 4096 2010-12-22 22:43 rails_3_0_x

[email protected]:~/ra/apps/trials$ rails_2_3_x/script/console
Loading development environment (Rails 2.3.2)
001:0> quit

[email protected]:~/ra/apps/trials$ rails_3_0_x/script/rails c
Loading development environment (Rails 3.0.3)
001:0> quit

Running the web servers in parallel:

[email protected]:~/ra/apps/trials$ rails_2_3_x/script/server -p 3000
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
^CExiting

In a different console terminal:

[email protected]:~/ra/apps/trials/rails_3_0_x$ rails s -p 3001
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on
http://0.0.0.0:3001
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-12-22 22:47:55] INFO WEBrick 1.3.1
[2010-12-22 22:47:55] INFO ruby 1.8.7 (2010-01-10) [i486-linux]
[2010-12-22 22:48:00] INFO WEBrick::HTTPServer#start: pid=4259
port=3001

Or did I overlook something ?

HTH,

Peter

Marnen Laibow-Koser wrote in post #970140:

Peter V. wrote in post #970139:

Colin L. wrote in post #970077:

On 22 December 2010 16:31, Fritz T. [email protected] wrote:

Is it possible, to run both versions side by side on the same ubuntu
10.04, or do I have to expect difficulties?

No problem provided you use rvm

Colin

Maybe ‘rvm’ is not a critical requirement for this (?)

RVM is the best way to do it.

I think the requirement is to have:

  • either the different versions of the gems installed
  • or to vendor the rails versions

Right. And RVM is the easiest way of managing that (thanks to its
gemset features). If you’re using different Ruby interpreters, RVM is
essential.

Thanks for that hint. It lead me to this page:

http://rvm.beginrescueend.com/gemsets/basics/

Now that we have bundler (with it’s Gemfile) and rvm,
what would be the best way to run e.g. a Rails 2.3.8
and a 3.0.3 on the same Ruby 1.8.7 version in rvm ?

Would it be useful to use rvm gemsets, or just rely
on bundler to select the correct gem versions from
a single default rvm gemset?

Thanks,

Peter

Peter V. wrote in post #970143:
[…]

Thanks for that hint. It lead me to this page:

http://rvm.beginrescueend.com/gemsets/basics/

You hadn’t read that before?

Now that we have bundler (with it’s Gemfile) and rvm,
what would be the best way to run e.g. a Rails 2.3.8
and a 3.0.3 on the same Ruby 1.8.7 version in rvm ?

Would it be useful to use rvm gemsets,

Of course. That way each project is completely independent.

or just rely
on bundler to select the correct gem versions from
a single default rvm gemset?

Why make extra work for yourself?

Thanks,

Peter

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

Peter V. wrote in post #970139:

Colin L. wrote in post #970077:

On 22 December 2010 16:31, Fritz T. [email protected] wrote:

Is it possible, to run both versions side by side on the same ubuntu
10.04, or do I have to expect difficulties?

No problem provided you use rvm

Colin

Maybe ‘rvm’ is not a critical requirement for this (?)

RVM is the best way to do it.

I think the requirement is to have:

  • either the different versions of the gems installed
  • or to vendor the rails versions

Right. And RVM is the easiest way of managing that (thanks to its
gemset features). If you’re using different Ruby interpreters, RVM is
essential.

[…]

Or did I overlook something ?

You overlooked the fact that without gemsets and interpreter management,
this gets messy fast.

HTH,

Peter

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote in post #970178:

Peter V. wrote in post #970143:
[…]

Thanks for that hint. It lead me to this page:

http://rvm.beginrescueend.com/gemsets/basics/

You hadn’t read that before?

No. I am fairly new to rvm. Figured out

$ rvm gemset help

as a useful command for exploration :slight_smile:

Now that we have bundler (with it’s Gemfile) and rvm,
what would be the best way to run e.g. a Rails 2.3.8
and a 3.0.3 on the same Ruby 1.8.7 version in rvm ?

Would it be useful to use rvm gemsets,

Of course. That way each project is completely independent.

OK, that’s good. I’ll try it out.

Thanks again,

Peter