A Quick Guide to Ruby & Rails Version Upgrades

A Quick Guide to Ruby & Rails Version Upgrades

blog post publisher

Victor Motogna

Head of Web Development

Reading time: 5 min

Published: Jul 15, 2022

Rails 6 upgrade
new rails version
rails upgrades
rails upgrade services
rails app
rails application
ruby on rails
upgrade ruby 2.7 to 3
upgrade rails

We recently needed to upgrade a project’s Ruby version from 2.6.6 to 3.x and the Rails version from 6.0.4.8 to 7.x, as part of our development process. The task's scope proved to be much more demanding than expected, as we encountered plenty of challenges, some better documented than others. So if you are going through a similar process, this article will include all the main changes that we had to deal with. 🗒️

Short disclaimer: this does not include the changes behind the hood that Ruby and Rails have done with their upgrades. These are widely covered, and we highly recommend these resources: upgrading Ruby, upgrading Rails. The mentioned guides also include some implementation changes that need to be done. This is the main goal of the article as well, but we’ll also cover some unexpected situations that are not included there. If you want to see what the latest Ruby supported versions and updates on the new releases are, check this resource.

 

Let's start with Ruby💎

We started with the Ruby upgrade, and we strongly recommend everyone does the same. First of all, Rails 7 requires Ruby 2.7.0 or a newer version, and we only had 2.6.6. Then, many of the gem updates will depend on their compatibility with Ruby 3, and overall, most of the work had to be done with this version upgrade.

Let’s get started! 🚀

We are using rbenv, so updating the version on the computer was pretty easy. After installing Ruby 3.1.2 (in this case) and updating it in the project Gemfile, try to run “bundle install” and then run the tests. Unfortunately, gem incompatibilities pop up immediately. 

This is the first takeaway we want to talk about. Having some gems versions locked for more than one year probably means that those versions are incompatible with Ruby 3. You will probably know which dependencies need an update, but we’ll cover three specific examples:

  • Rspec-rails - this is the testing gem of choice on our project, and it needed an upgrade to version 5+ on our project.
  • Faker - we mostly use this gem for specs & factories. Upgrading the Faker version did come with some changes, as all the methods now needed keyword arguments to work properly (Faker::Number.unique.number(digits: 2) instead of Faker::Number.unique.number(2)).
  • Psych - this was a bizarre issue. A very detailed explanation can be found here. In short, Ruby 3.0 comes with Psych 3, while Ruby 3.1 comes with Psych 4, which has a major breaking change; the fix for us (at least for the Ruby upgrade) was to add this - gem ‘psych’, ‘< 4 - to the Gemfile, to enforce psych version under 4.x; that also meant that we had to change the default version from the computer for psych from 4.x to 3.3.2 (gem install --default -v3.3.2 psych and then follow this comment to remove the 4.0.4 version).

There may be many other incompatible gems from your Gemfile that you might not use or that might have a different version. These are the ones that required the most work on our side and are also the most widely used.

After advancing from the gems’ incompatibilities, we had to ensure that the new Ruby 3 updates were also applied on the project. One of the main changes we had to deal with was a change when using positional or keyword arguments (more details here).

For example, we had: let(:params) { key1: ‘value1’, key2: ‘value2’ } & service_base_child.call(params). This had to be changed to service_base_child.call(**params).

Finally, we could move to the easy task: updating Docker & CircleCI images.

 

Upgrading Rails 🛤️

Our version for Rails (and its dependencies) was 6.0.4.8. Because of security vulnerabilities and small changes, this has been updated a few times since the start of the project. Still, like with the Ruby version, the updates were incremental and very small. Fortunately, the Rails version upgrade does not produce so many incompatibilities, and most of the changes were syntax, config, or implementation changes rather than gem updates.

Fortunately for us, the Ruby on Rails site has a great guide on how to upgrade to the current Rails version. We won’t cover what’s already there, but some smaller things aren’t as smooth as expected. ⚠️

So the first step, also covered in the guide, is updating the Gemfile and the gems, and then running rails app:update. This will trigger a set of changes in many of the files already present in the project. We suggest allowing inserts/updates for all of the files and manually going through each git diff to see whether the changes make sense. Many changes are just updating single quotes to double quotes, but also expect some critical changes. Also, be careful if the update removes any specific settings, like action mailer config.

From the Rails upgrade, we only had five main takeaways/updates to take care of. Of course, there were some smaller changes, like some other gem upgrades, but they are easy to catch and handle.

  • Inside the application.rb file, the config.load_defaults value should be 7.0. This will load the default configuration Rails has set up for version 7+
  • Updating to the new Active Record encryption - this means changing everything that used attr_encrypted to this new implementation. Fortunately for us, we only used attr_encrypted for some third-party APIs access tokens, so we did not need to migrate instances in our database. We could just delete them and then generate them again. If you need to persist that data, some special steps need to be taken into consideration; this guide describes how to do that. But for us, writing up a migration to remove columns encrypted_access_token & encrypted_access_token_iv, which were required attributes for the attr_encrypted gem, and also add a new attribute, access_token, as a string. Also, attr_encrypted :access_token, key: :some_key will now become encrypts :access_token. The next step would be running rails db:encryption:init, which will then generate a set of keys to be added to the credentials. Also, we found that adding this line config.active_record.encryption = Credentials[:active_record_encryption] to each environment file is required for the Rails app to find and use these values for the encryption.
  • errors[:base] << 'foo' needs to be replaced with errors.add(:base, 'foo').
  • If, like us, you are using bullet, I recommend upgrading bullet to the latest version and making sure no n+1 warnings are thrown. In my case, it looks like the new version caught about 10 cases that weren’t considered n+1 queries before. Double-checking that might save some seconds from the next query.
  • Also, if you are using CarrierWave and have attachments, be mindful that the attachment.file#filename method is deprecated, so you should change that to attachment.file#identifier. Also, Kernel#open now should be refactored to URI.open, or even better to URI.parse#open.

 

Conclusions💡

For us, working on the upgrade brought to light three main key takeaways, and these are the reasons we decided to write about this topic:

  • Write tests! Having great test coverage has made my job so much easier. Changing some methods because of deprecation, migrating to the new encryption system, or upgrading some libraries? Just run the test suite. If everything passes and the coverage is good, you can confidently say the change was successful. Otherwise, you can easily miss some things because “there’s nothing new here”, but a validation error can still pop out.
  • Take your time. For us, this task took longer than I expected. Many situations like inconsistencies or incompatibilities will appear, and they are very particular to each project, previous versions, and the number of dependencies. Also, after an update like this, you should thoroughly test the API or the app to make sure nothing goes unnoticed. In our case, the Kernel#open issue did slip by initially. 
  • Think about the reason to upgrade. As we mentioned above, it is a long task. Having the latest version and the latest security fixes, bug fixes, updates and so on might be good, but major version changes need consideration. We should all upgrade ongoing projects at some point but choose that timing carefully.

We want to thank you for your interest and hope this guide will help you with your own upgrades. We prepare articles like these whenever our community or we run into unexpected difficulties and no helpful resources. So, if there’s a technical problem you’re battling, don’t hesitate to shoot us a message, and we’ll do our best to help! 👐


About Wolfpack Digital🐺

With over 140 projects successfully delivered to our partners, we are a web and mobile app development company. Our mission is to bring performance and beauty to the world through technology. 
We develop projects start-to-end and have extensive expertise in beauty app design and development, fintech app development, healthcare IT solutions, custom website development, cross-platform app development services, and many more.

Do you have a project in mind? Get in touch with us, and let's talk more

Have you ever wondered how to develop mobile apps with Ruby on Rails? We have prepared an article on this topic, so make sure to read it!

Victor Motogna

Written by

Victor Motogna

Head of Web Development

Victor Motogna is the Head of Web Development at Wolfpack Digital, leading the web development team and driving innovation in scalable, secure web applications. With a Bachelor's in Computer Science and a Master's in High Performance Computing & Big Data Analytics, he brings deep technical expertise and a forward-thinking approach to building enterprise-grade solutions.


As both a technical leader and hands-on contributor, Victor works across the full technology stack including Ruby on Rails, Vue.js, Nuxt.js, JavaScript, and Python, with extensive experience in DevOps frameworks and cloud infrastructure (Azure, AWS, Kubernetes). His role extends beyond traditional web development—he plays a key part in architecting AI-powered features, training machine learning models, and ensuring AI integration delivers genuine business value rather than following trends.


Victor's leadership philosophy centers on balancing technical excellence with practical delivery. He excels at translating complex technical concepts into clear business language, architecting solutions that strike the right balance between technical sophistication and MVP speed, and staying ahead of rapid technological change. His approach emphasizes building stable, secure end-to-end solutions while constantly seeking smarter, more efficient development processes.


A frequent speaker at technology conferences across Europe, Victor shares insights on modern web development practices, AI integration strategies, cloud architecture, and building high-performing development teams. His writing draws on real-world experience delivering 250+ digital products and reflects his commitment to using technology to create meaningful solutions that improve people's lives.


Through his blog contributions, Victor explores topics at the intersection of web development, AI, and entrepreneurship, focusing on practical implementation strategies, technology decision-making, and fostering knowledge exchange within development teams.


Areas of expertise: Web application architecture, Ruby on Rails development, Vue.js/Nuxt.js, AI integration, machine learning model training, DevOps and cloud infrastructure, team leadership, full-stack development, technical strategy, scalable systems design.

View profile
insights

related articles

How to Build Your MVP in 2 - 4 Weeks: The AI-Native Approach

How to Build Your MVP in 2 - 4 Weeks: The AI-Native Approach

blog post publisher

Andi Nicolescu

CTO

Reading time: 5 min

May 26, 2026

Wolfpack Digital's CTO on how an AI-native MVP ships in 2–4 weeks without lowering the engineering bar, what's actually changed in design and engineering workflows, and how my team delivers it.

3D illustration of a developer coding on a laptop, surrounded by code windows, a settings gear and a dollar coin, representing mobile and web app development costs

How Much Does It Cost to Build a Mobile or Web App? A Complete Guide

blog post publisher

Oana

Marketing Specialist

Reading time: 12 min

Mar 2, 2026

A complete 2026 guide to mobile and web app development costs: the factors that drive your budget, the hidden costs, and how AI shifts where time and money go.

Photo collage from Wolfpack Digital's Breakfast & Insights event in Dublin, May 2026, held at a venue with botanical-themed glass walls and greenery. The images show the Wolfpack team posing together, attendees seated at round tables during talks, presentation screens displaying the event branding and a product slide, networking moments between guests, a Wolfpack 'Powerful tech products start-to-end' banner, and a group selfie of smiling attendees.

How to Choose a Software Development Partner | Takeaways from Breakfast & Insights, Dublin

blog post publisher

Cristina Strîmbu

Marketing Specialist

Reading time: 5 min

Jun 9, 2026

Founders gathered in Dublin to answer one question: what should I build, and can I afford it? Here's what the room said about choosing a software partner.