Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading from Rails 2.3.8 to 4.0

Tags:

I am running an application on Rails 2.3.8. I am planning to upgrade it to Rails 4.0 (which is in RC). What will be the easiest way for me to do this? Do I need to first upgrade to Rails 3.x?

Note: in my current implementation, I am using starling and ferret; as part of upgrade I am also considering to move to sidekiq and sunspot

like image 316
nit Avatar asked Jun 17 '13 06:06

nit


1 Answers

This is a multi-step process, and depending on the size of your application, it can take a long time. At each step, you'll want to test your application for bugs and problems and broken gems (because they are most certainly going to crop up). I have included links for the most complicated steps. Here is the path of least pain:

Update to Rails 2.3.18.

Update to Ruby 1.9.3.

Update to Rails 3.0.

  • Part 1
  • Part 2
  • Part 3

Update to Rails 3.1.

Update to Rails 3.2.latest.

Update to Ruby 2.0.latest.

Update to Rails 4.0.

Update from Rails 4.0 to Rails 4.1.

Update from Rails 4.1 to Rails 4.2.

Update from Rails 4.2 to Rails 5.0.

Update from Rails 5.0 to Rails 5.1.

Bonus: If you have a large application, this is going to take a long time. If you have a large team, long-running branches become a huge headache because of recurring merge conflicts. One strategy for mitigating this is to dual boot your application with both versions of Rails so that you can have the new version running on your master branch, rather than on a long-running branch of its own.

like image 129
Aaron Gray Avatar answered Oct 26 '22 20:10

Aaron Gray