Skip to content
Latchkey

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.

Bundler
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

  1. Run bundle lock --add-platform x86_64-linux (and ruby if you want a source fallback).
  2. Commit the updated Gemfile.lock.
  3. Re-run CI so the Linux gem variants resolve.
Terminal
bundle lock --add-platform x86_64-linux ruby
git add Gemfile.lock

Lock all CI platforms up front

Add every platform your pipeline uses so no runner ever hits an unsupported-platform stop.

Terminal
bundle lock --add-platform x86_64-linux aarch64-linux

How 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →