Maksym Prokopov
Personal blog powered by a passion for technology.

Upgrading Rails to 8.1 and fixing incompatible gems

25.10.2025
Reading time: 2 min.

You probably faced similar error.

Could not find compatible versions

Because every version of paranoia depends on activerecord >= 6, < 8.1
  and rails >= 8.1.0 depends on activerecord = 8.1.0,
  every version of paranoia is incompatible with rails >= 8.1.0.
So, because Gemfile depends on rails ~> 8.1
  and Gemfile depends on paranoia = 3.0.1,
  version solving has failed.

This means your gem paranoia wants activerecord with version less than 8.1, but you tested and know it should work.

Oftentimes author of a gem stoped doing updates in GitHub, but you anyway want to proceed with release.

How to move on?

For this we need to understand concept of vendoring.

Vendoring

Vendoring is making a copy of a gem, typically in vendor/gems folder.

This allows you to apply minor fixes, to remove versions checks making this gem incompatible.

In this way I vendored and made changes to the following gems, to make them compatible with Rails 8.1

  • telegram-bot
  • paranoia
  • globalize

Lets explore example of paranoia gem.

gem unpack paranoia

This will create a folder paranoia-3.0.1, just move it under vendor/gems folder. and make this change to the Gemfile.

- gem "paranoia"
+ gem "paranoia", "3.0.1", path: "vendor/gems/paranoia-3.0.1"

Change in vendor/gems/paranoia-3.0.1/paranoia.gemspec

- s.add_dependency 'activerecord', '>= 6', '< 8.1'
+ s.add_dependency 'activerecord', '>= 6'

Now run bundle install. It should finish with no errors.

Create a PR and commit your change. Now it should work with Rails 8.1 🎉