Why you should keep your gems up to date?

I have to confess that until last year I was not paying attention
to keep gems updated. My top 3 excuses:

  • “I have no time”
  • “I don’t want to introduce new bugs for free”
  • “It has not got new features that pay the bill”

Last year with Rails 5 release and Rails 3 out of support we had to update Playfulbet.com application from Rails 3.2 to Rails 4.2.

“I had to find time” because “It was going to pay the bill”.

After the experience I became fan of having dependencies updated as much as possible. I learnt some lessons.

The rest of the world does not care about the version you have in production.

That’s life. Open Source goes on.

You think that you will never have to update that small simple gem that just works. But, one day you’ll have to, you’ll have to upgrade Rails and that small gem will not be ready for this new Rails version. (True story)

Rails new releases force to update gems.

The sooner you update a gem, the sooner that new features are compliant.

You can use outdated gems for a long time. All this time you will incorporate code to your codebase that will rely on these outdated gems. You will develop tests as well and invest resources for testing and QA.

Is it not better to update gems as soon as possible so testing and QA investment lasts longer?

Know your enemies as soon as possible

When you try to update a gem as it is released and it breaks your application feel fortunate. It is not nice, I agree, but it is good, you found it on time, you did a good job. You know that you have a pending battle here.

What else can you do?

  • Create an issue in your issue tracker to plan the battle properly.
  • Write a small comment in the Gemfile file explaining why this gem is locked in this version and what breaks.

Don’t be afraid

Most of the times, updating a gem is not a pain. It is just a patch or a minor version and this is normally straightforward.

Even in the worst case, if updating a gem becomes a problem, isn’t better to know it as soon as possible? Update early, update often.




Senior Software Engineer @ Jobandtalent. Previously CTO @ Playfulbet.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Santi Bel

Santi Bel

Senior Software Engineer @ Jobandtalent. Previously CTO @ Playfulbet.

More from Medium

Key Benefits Of Choosing Ruby On Rails For Your Project

RailsTasker: Rails Automated Post Deployment Tasks

Ruby on Rails post deploy task automation

Linking Dependent Updates Across Multiple Tables in Ruby on Rails

About Ruby on Rails