Ruby on Rails Friday, February 1, 2019


On Feb 1, 2019, at 12:02 AM, Hasan Diwan <hasan.diwan@gmail.com> wrote:

To be safe, go through a stepwise upgrade, running and fixing your tests at each step. -- H

On Thu, 31 Jan 2019 at 23:50, raj kumar <2017kamb@gmail.com> wrote:
I have a Rails app, made 10 years back in 2009 with following version:
rails version = 2.0.2 
ruby version = 1.8.7
Database = PostgreSQL

Now what steps I should adopt in order to upgrade it to latest version of ruby and rails i.e.,
rails version = 5.2
ruby version = 2.6
Database = PostgreSQL

As per up-gradation rule here(https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html), I need to start up-gradation one by one version gradually like,
2.x to 3.x
3.x to 4.x 
4.x to 5.x

My question here is, 
Is there any other way to directly update it from 2.x to 5.x?

Note: I can develop it by scratch but my client not agree on that, they just asking for update in existing app not build from scratch in latest version of Ruby on Rails.

Kindly provide your thoughts.

Thanks 

Good advise by Hasan.  If the project isn't that complex, though, you could just jump to the latest.. .sometimes rewriting incrementally can be a painful waste of time just to rewrite again as you go from each increment to the next.

Latest Ruby should be the least of your problems... you will get huge code speedups from nothing more than upgrading Ruby.  Most of the changes to Ruby since 1.8/1.9 to 2.6 have been to garbage collection speedups.

ActiveRecord changes and routes might be your most significant rewrites.  Because we're looking at Rails 6 beta as the current, you could also leapfrog to that?  (depending on your scheduling and policies on using betas)

Good luck!


Phil

No comments:

Post a Comment