Bundler "your bundle only supports platforms" mismatch in CI
The lockfile records which platforms it was resolved for. When CI runs on a platform not in that list (commonly x86_64-linux, while the lock was built on arm64-darwin), Bundler refuses to install platform-specific gems and stops.
What this error means
bundle install fails with "Your bundle only supports platforms [\"arm64-darwin-23\"] but your local platform is x86_64-linux" and suggests bundle lock --add-platform.
Your bundle only supports platforms ["arm64-darwin-23"] but your local platform
is x86_64-linux. Add the current platform to the lockfile with
`bundle lock --add-platform x86_64-linux` and try again.Common causes
The lock was generated on one OS only
A developer on Apple Silicon committed a lock with only a darwin platform, so a Linux runner is unsupported.
Platform-specific gems have no Linux variant locked
Gems like nokogiri ship per-platform binaries; without the Linux platform locked, the right variant is not available.
How to fix it
Add the runner platform to the lock
- Run bundle lock --add-platform x86_64-linux (and ruby if you want a source fallback).
- Commit the updated Gemfile.lock.
- Re-run CI so the Linux gem variants resolve.
bundle lock --add-platform x86_64-linux ruby
git add Gemfile.lockLock all CI platforms up front
Add every platform your pipeline uses so no runner ever hits an unsupported-platform stop.
bundle lock --add-platform x86_64-linux aarch64-linuxHow to prevent it
- Add x86_64-linux to the lock so Linux runners are always supported.
- Lock every platform your matrix runs on, not just the dev machine.
- Review Gemfile.lock PLATFORMS after regenerating on a new machine.