Will upgrading gems break old Rails applications?

Question!

I have bunch of Rails apps running on Rails 1.x. I need to upgrade the gems so the question is, will these old apps still work after I upgrade gems?

Thank you.



Answers

It's just like any other dependency. Look at the version number for each gem:

1.2.3

In this case, 1 is the major version. If this number has changed, then definitely do not upgrade. It will require work to use the new one.

2 is the minor version. You should be safe upgrading if only this number has changed, but be careful. Do a lot of smoke tests.

3 is a bug fix release. You can definitely upgrade if only this has changed. It's unlikely only this one has changed after so long, but if that's the case you're safe.

Unfortunately these are only guidelines, and many open-source projects among others do not follow them very well. So take the advice with a grain of salt.



If you are running with rails 1.x and you upgrade the rails gem, your application will break. Rails 2.x is very different.

Concerning other gems, they might break. Read the releases note, usually authors warn about backward compatibility.

If you don't want to upgrade, you could also freeze the gems.

By : marcgg


It depends. If you're talking about upgrading to the latest gems that comprise Rails then if the applications use features that were long ago deprecated and subsequently removed, then they will break.

The only way to know for sure is to try it. Look out for deprecation warnings in the development log. Hopefully you have good test suites in place.



This video can help you solving your question :)
By: admin