Bundler "Bundler::VersionConflict" in CI - Fix Conflicting Requirements
Bundler raised a VersionConflict because no single set of versions satisfies every requirement at once. Two gems demand incompatible versions of a shared dependency, so the resolver gives up. This is deterministic, not transient.
What this error means
bundle install or bundle update aborts with Bundler::VersionConflict, naming the gem in conflict and the requirements pulling it in opposite directions. The same Gemfile fails the same way every run.
Bundler::VersionConflict: Bundler could not find compatible versions for
gem "faraday":
In Gemfile:
octokit (~> 7.0) was resolved to 7.0.0, which depends on
faraday (>= 1, < 3)
some-sdk was resolved to 1.0.0, which depends on
faraday (~> 0.17)Common causes
Two gems pin incompatible shared versions
Gem A needs faraday (>= 1) while gem B needs faraday (~> 0.17). No single faraday release satisfies both, so the resolver cannot proceed.
An over-tight pin in your Gemfile
A hard version pin you added conflicts with what another gem requires. Loosening it to an overlapping range often resolves the conflict.
How to fix it
Relax or align the conflicting constraint
- Read which gem is in conflict and the two requirements pulling it apart.
- Loosen your own pin to a pessimistic range (~>) that overlaps both, if one exists.
- If two third-party gems conflict, upgrade the lagging one to a release that accepts the newer shared dependency.
Update just the conflicting gems
A targeted update lets the resolver find a compatible set without churning the whole lockfile.
bundle update octokit some-sdk
bundle installHow to prevent it
- Pin with pessimistic ~> ranges, not exact = versions, unless required.
- Upgrade related gems together so shared dependencies stay compatible.
- Commit Gemfile.lock so conflicts surface in PRs, not just in CI.