Crashalot
Crashalot

Reputation: 34513

Porting from Rails 2.3.x to 3.x?

Has anyone had any experience porting from Rails 2.3.x to Rails 3.x?

Any pitfalls to be aware of or suggestions you could make?

Thanks!

Upvotes: 3

Views: 391

Answers (4)

Ryan Bigg
Ryan Bigg

Reputation: 107728

I did an upgrade over a week in November and documented the process (after the fact, going by the commits) in this post: http://ryanbigg.com/2010/11/the-rails-3-upgrade. Pan's answer covers most of the problems that we encountered.

Upvotes: 0

Dimas Cyriaco
Dimas Cyriaco

Reputation: 184

I encourage you to take a look at the rails_upgrade gem (https://github.com/rails/rails_upgrade) written by the same guy how wrote the Rails 3 Upgrade Handbook. Very helpfull.

Upvotes: 0

Pan Thomakos
Pan Thomakos

Reputation: 34350

There are lots of online resources about performing this upgrade. From firsthand experience the issues that arise most and first are:

  • Gem Incompatibilities: There are many gems that only work with Rails 3, and gems that used to work in Rails 2 might no longer work in Rails 3. Make sure you get the latest gem versions and that you read the documentation to ensure that the gems you depend on are supported.
  • Configuration Changes: There's nothing special about them, but there are lots and you'll have to go through the grunt work of making them.
  • Ruby 1.8.7 or Greater: You can't run Rails 3 with Ruby 1.8.6. If you aren't already doing so though, you should at least be on Ruby 1.8.7. If you also want to upgrade to Ruby 1.9.x then you'll have a whole slew of other gem extension issues to deal with, so I won't go into that here because you're only asking about Rails 2 to Rails 3.
  • Bundler: If you aren't already using it, you should be. It makes managing gems and gem dependencies much easier. You have to use Bundler with Rails 3.
  • No ./script/... Anymore: All calls are made through the rails script: rails console, rails db and rails generate.
  • Architecture: There are lots of architectural and syntactic changes, and you can read more about them here.

Upvotes: 2

Dylan Markow
Dylan Markow

Reputation: 124419

You might check out the Rails 3 Upgrade Handbook by Jeremy McAnally. 120-page handbook with tons of information on upgrading. Well worth the price, for sure.

Upvotes: 3

Related Questions