views:

54

answers:

2

I'm looking to deploy two rails projects. One with Ruby 1.8.7 and Rails 2.3.8, and another with Ruby 1.9.2 and Rails 3.0.1.

I'm trying to set up a situation where www.example.com is Ruby 1.9.2 and shop.example.com is Ruby 1.8.7.

What's the best way to set this up with Passenger and RVM?

+1  A: 

In terms of rails version it's quite easy because you just need to freeze (which means store) the rails versions you want in the vendor/rails dir.

 rake rails:freeze:edge RELEASE=2.3.8

And then you can just keep your default at 3.0 or visa versa or freeze both.

In terms of different ruby versions I've never done that. For me it's just less of a headache to have a default and then freeze gems. But here is something that works with what you are doing: http://www.sportscomet.com/sports_thread/view/id-26403

Sam
I have thought of doing it that way. Just using 1.8.7 with two gemsets. Probably will be less headaches in the end.
ScotterC
+1  A: 

There's a blog post explaining pretty much what you want by the phusion people here: http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/

(Actually it's the same info as the link given by Sam - but I think this is the original with clearer layout)

It basically involves running a version of passenger standalone with one version of ruby, and proxying requests to it from apache/nginx that is running the other version.

matt