简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM