Bundler version conflict — Gemfile.lock out of date
Fix Bundler version conflicts and Gemfile.lock errors. Resolve incompatible gem version constraints in Ruby projects.
⚠ Error Message
Bundler could not find compatible versions for gem 'rails':
In Gemfile:
rails (~> 6.0) was resolved to 6.0.0, which depends on
actionpack (= 6.0.0)
Root Cause
Your Gemfile specifies version constraints that conflict with the current Gemfile.lock, or two gems require incompatible versions of a shared dependency.
How to Fix
- Run bundle update --bundler to update Bundler itself first.
- Run bundle update
to update only the conflicting gem and its dependencies. - Check Gemfile for overly strict version constraints (~> vs >= vs exact pins).
- Paste your Gemfile into PackageFix to scan for CVEs — a security fix may require a version that triggers the conflict.
Scan your dependencies now — paste your manifest, get a fixed version back in seconds.
Open PackageFix →No signup · No CLI · No GitHub connection · Runs 100% in your browser
Frequently Asked Questions
How do I fix 'Bundler could not find compatible versions'?
Run bundle update to update the specific gem. If that fails, check for conflicting constraints in your Gemfile.
Should I delete Gemfile.lock to fix conflicts?
Deleting Gemfile.lock and running bundle install regenerates it with latest compatible versions. This works but may introduce unintended updates — check the diff.
How do I fix a CVE without breaking gem version constraints?
Update the gem's lower bound in Gemfile to the safe version: gem 'rails', '>= 7.1.3'. PackageFix shows the minimum safe version for each CVE.
What is the difference between bundle update and bundle install?
bundle install installs gems according to Gemfile.lock. bundle update resolves fresh versions from Gemfile constraints and updates the lockfile.