Bundler "frozen mode" Lockfile Mismatch in CI
Bundler is running with frozen (deployment) mode enabled, which forbids changing Gemfile.lock during install. When the Gemfile and lockfile differ even slightly, the install aborts instead of re-resolving.
What this error means
bundle install fails specifically because frozen/deployment mode is on and the Gemfile.lock would need to change. The message tells you to run bundle install locally and commit the lockfile. It is intentional protection, not a bug.
The lockfile does not match the gemfile. Running in deployment mode,
where changes to the Gemfile.lock are not allowed.
You have added to the Gemfile:
* rack (~> 3.0)Common causes
Deployment mode plus an out-of-date lockfile
CI enables --deployment or sets BUNDLE_FROZEN, which pins the lockfile. Any Gemfile change not reflected in Gemfile.lock then fails the install.
Lockfile generated on a different Bundler or platform
A lockfile produced by a different Bundler version or missing platform entries can differ from what CI expects, tripping frozen mode.
How to fix it
Regenerate the lockfile and commit it
Re-resolve locally without frozen mode, then commit so CI has a matching lockfile.
bundle install
git add Gemfile.lock && git commit -m "Sync Gemfile.lock"Toggle frozen mode deliberately
On a disposable runner where you intend to re-resolve, turn frozen off for that job only.
bundle config set frozen false
# or re-enable it explicitly
bundle config set --local frozen trueHow to prevent it
- Commit Gemfile.lock and keep frozen mode on in CI.
- Re-run bundle install after every Gemfile edit.
- Standardize the Bundler version across local and CI so lockfiles match.