Current Ruby Version is 2.3.1 and want to upgrade it to 2.6.5; Rails version 5.2.2, later some time want to upgrade it to 6.0.0

My first question is would it be good approach to directly upgrade to 2.6.5 or to upgrade by major versions ??

And second question, is there any tool or gem available to verify the Deprecation warnings or compatible methods of the new version.

So that it helps in verifying the deprecation and other incompatible methods before final check in to repository or a there's a script that can traverse my code searching for potential issues?

I know one of the best way is to ensure the smoother upgrade is to run the complete test coverage before and after upgrade.

Would like to know other means for upgrade like a tool/gem or any script particularly.

Thanks in Advance

1

There are 1 best solutions below

0
On

The recommended upgrade path is to do incremental minor version updates whenever possible. But in the case where you are several minor versions behind as in your case, you will likely be safe to go to later versions of 2.x without any breaking changes. But to be sure, you will want to search the release notes of said version, i.e. Search Ruby 2.6 released which should yield results including the release notes for 2.6.0. To be safe, you may want to search that page for breaking changes then just changes. Which there seem to be no breaking changes between 2.3.x up to 2.7x.

Mostly there will be enhancements and performance improvements, but each version may contain deprecation warnings. You will want to address these before upgrading to next major version Ruby 3.0 or 3.1.

You can use the gem deprecation_toolkit to assist with fixing deprecated code before trying to update to a major version, 3.x for example.

Of course the hard part will be making sure all your gem dependencies are dated, normally by running bundle update but in some cases you will have to resolve individual dependencies with more hand work.