Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade to Ruby on Rails 3.0, 3.1, or 3.2 from 2.3.11?

I'm getting ready to (attempt to) upgrade a Rails application from 2.3.11 to 3.X, and I'm wondering what upgrade path others would recommend. Right now (March 2012), 3.2 is the latest Rails version, but I'm wondering if I would be better suited targeting an earlier version in order to minimize the upgrade pain.

In particular, I'd like to avoid over-shooting the mark on deprecations and legacy support. For instance, if there are parts of legacy ActiveRecord that are deprecated in 3.1 and removed in 3.2 then I think I'd rather go for 3.1 or even 3.0.

Current configuration:

  • Rails 2.3.11
  • Ruby 1.8.7 (ree-1.8.7-2012.01 in production)
  • Already upgraded to bundler

If anyone has gone through this and could point to a specific version to target, that would be a big help.

like image 432
Micah Avatar asked Nov 04 '22 04:11

Micah


1 Answers

I just did this recently and found it very helpful to take an incremental approach and work through all the deprecation warnings as I upgraded. If you have good test coverage, you can look at the deprecation warnings that are spewed when running your tests suite. If not, then you'll want to look at your server logs for deprecation warnings very carefully. One thing that bit me was the ERB change from using <% to <%= for content blocks when we upgraded from 3.0 to 3.1 because they will fail silently.

like image 134
Peter Brown Avatar answered Nov 15 '22 05:11

Peter Brown