views:

68

answers:

3

Hi folks, I have a old app made on rails 1.2.5, this application have alot of access per day.

I intend to upgrade my server (a joyent accelerator) to run ruby 1.9.x and work with rails 3 but I can't stop or move this app to another server.

Have any way to run this application on ruby 1.9? or run two ruby versions (1.8.7 and 1.9) at the same time? or on the last case upgrade my app to work with rails 3?

Thanks.

A: 

There was quite a few patches to Rails to make it run under Ruby 1.9. I think you are up for a challenge if you try to do that. With Ruby Version Manager you can work with multiple ruby environments from interpreters to sets of gems.

Jonas Elfström
Yeah I know that it's very difficult, but I tried to run rvm, but I have some questions about the best way to run it on a production server, where there are alot of applications on different rails versions.Have you ever do some thing like that?Are you have some idea about how to do it?
GodFather
Not really but I have both 1.8.7 and 1.9.2 on a production server. Only using 1.8.7 for now though. But it seems it's just a matter of installing rvm and then adding project .rvmrc's http://rvm.beginrescueend.com/workflow/rvmrc/
Jonas Elfström
Jonas, I did some tests and your idea works fine, I'll create a .rvmrc file to each new project, and the old projects will continue running on ruby system version.
GodFather
+1  A: 

Does it have to be switched over to Rails3 and Ruby 1.9? Can you just throw you old app on a virtualized server and keep the app running as is?

The reason for my suggestion is that we just went through a similar case. A local business (a construction association) had a pair of apps developed for them 2-3 years ago (works with Rails 1.2.6). Nothing overly major (a billing app, and a bid/contractor/customer management system). Everything works, so no need to update anything.

Their hosting provider was not willing to keep an old outdated rails available in shared hosting environment. Hosting shop cited maintenance can't be streamlined, security concerns, etc. Sure enough, the same host offers to rewrite the apps for current technologies (for a price, of course).

Client wasn't happy with them. The shop that developed the apps since closed and the developers left for greener pastures. But everything works, so why reinvent the wheel, right? Client went looking for alternatives. Came to us. We sat down with the client, did some cost/benefit analysis and decided to just host in a virtualized environment (at another provider). Did that in a week (with some hick-ups): back-up, move, restore, test, everything works. And it's been working now for 3 months without any issues.

This might not work for you, but unless you need to add to the app why fix what ain't broken?

Swartz
It's a good idea, but it's so expensive, and the budget not allow it. I'll try the Jonas idea to use a rvm and differents .rvmrc to each user, in other words the old apps will run on ruby 1.8.7 and the news will use 1.9. What do you think about?
GodFather
If rvm will work for you, go for it! But if it doesn't, then you still have to decided (cost/benefit) if it's worth to port the old app to new Ruby/Rails. I bet that the ongoing costs of a separate VM would be far less than the time spent coding/upgrading, testing, fixing bugs if rvm doesn't work out.
Swartz
A: 
  1. Rails 3 works with Ruby 1.8.7
  2. Another option (apart from obvious RVM) is to leave your Ruby 1.8.7 and Rails 1.x as is and install latest JRuby and Rails 3.0 and dependent gems with jruby -S gem install rails. Ruby and JRuby gems perfectly coexist without any interference. OpenSolaris in Joyent's Accelerator is good at running Java, so you won't have much problems with it.

P.S. Btw, I won't recommend updating your Rails 1.x app to 3.x, unless you're planning to add lots of new features to it. It can be very painful, especially if you used lots of old-school gems and plugins.

buru