Question

I'm about to start working on porting a company's old rails ap from 2.3/1.87 to the most recent version of rails. Should I wait for rails 4, or should I just to 3.2?

We're going to take the opportunity to make sure there is full test coverage, and there will probably be some rewriting involved as well. The first goal is to make sure all current functionality is operational.

We want as much of the current codebase as-is to work under the most recent version of rails. We will rewrite any parts that don't.

Was it helpful?

Solution

I would consider the following two choices:

A) Re-write the app.
In this case I would do it in rails 3.2.10 Don't wait until 4 as it has to be released, shaken down, bugs found, etc. With rails it's almost never good to wait as it has such a rapid release cycle with major changes. Something I've learned the hard way over the last couple of years.

B) Upgrade it incrementally.
I would also not wait until 4 comes, go to 3.2.10 now. Start by updating the 2.3 app to rails 3.0 This will probably not actually be that hard. There are a few format changes and active record changes but most are fairly straight-forward and documented well by others. Take careful note of deprecation warnings as these are often introduced in rails versions x.0 and then actually removed in x.1 (so in this case that means 3.0 and 3.1)

Once this is complete and you've kicked the tires around and made sure everything works, then move on to upgrading to rails 3.1 This is actually a pretty big upgrade as it introduces the asset pipeline. You'll need to read up on that and follow the advice. Don't 'cop out' by not using it for production. Basically it does two key things: minifies js code and compiles all js and css code into 1 file (each). This help speeds up web pages and reduce server requests for all the individual assets.

Next upgrade ruby from 1.8.7 to 1.9.3 This should be relatively painless but as with all the steps check the app carefully and obviously if you have automated regression tests they should be run (same for each step outlined here).

Finally upgrade rails from 3.1 to 3.2.11 which includes a security fix.


Which choice you make will depends on a great number of other factors, both technical and non-technical, including:

  • developer bandwidth
  • developer experience
  • budget
  • timeline
  • quality of code
  • size of codebase
  • number of users of the apps (thus impact any isssues will have).
  • availablity of customer support to field calls about issues.

Useful Resources:

OTHER TIPS

I think you need to update to 3.x at first, and after some time (when 4.1 or something like will be released) you will update your app to the latest Rails version.

I strongly recommend to create a huge work on making tests for the current codebase (if it is not done yet). When you get updated to Rails 3 you will get a good base of bugs which you need to fix before production.

And there are lot of tutorials (video and text) about how to update 2.x to 3.x Rails apps.

My recommendation: update your current app to 3.2 and wait until 4.x branch will come to stable and you can use it in production mode (it will take about 4-8 months from release of 4.0)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top