Skip to content
Latchkey

Bundler "Could not find compatible versions for gem X" in CI

Bundler walked your dependency graph and proved no version of a shared gem satisfies every requirement at once. It prints the conflicting requirements and the requested ranges so you can see which two collide.

What this error means

bundle install or bundle update fails with "Could not find compatible versions for gem X" followed by the requirements that each demand a different range, often via transitive dependencies.

bundler
Bundler could not find compatible versions for gem "concurrent-ruby":
  In Gemfile:
    rails (~> 7.1) was resolved to 7.1.3, which depends on
      activesupport (= 7.1.3) was resolved to 7.1.3, which depends on
        concurrent-ruby (~> 1.0, >= 1.0.2)

    i18n (= 1.8.0) was resolved to 1.8.0, which depends on
      concurrent-ruby (~> 1.0, < 1.2)

Common causes

A direct pin caps a shared transitive dependency

One gem you pin caps a shared dependency below what another gem now requires, so no single version fits both.

Mismatched major versions in the Gemfile

Two gems were bumped independently and now require incompatible major ranges of a common dependency.

How to fix it

Loosen or upgrade the capping requirement

  1. Read the two requirement chains Bundler prints to find the shared gem.
  2. Upgrade the gem that holds the lower cap, or relax the direct pin that conflicts.
  3. Re-run bundle update for the involved gems to confirm resolution.
Terminal
bundle update i18n concurrent-ruby

Pin the shared gem to the overlapping version

If a single version satisfies both chains, add it explicitly so the resolver has a feasible point.

Gemfile
gem 'concurrent-ruby', '1.1.10'

How to prevent it

  • Upgrade related gems together so shared deps stay compatible.
  • Prefer pessimistic ranges over hard equality pins where possible.
  • Run bundle update locally and commit the lockfile before pushing.

Frequently asked questions

What causes ""Could not find compatible versions for gem""?
One gem you pin caps a shared dependency below what another gem now requires, so no single version fits both.
How do I fix "Could not find compatible versions for gem"?
Loosen or upgrade the capping requirement

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card