Bundler missing platform in Gemfile.lock ("PLATFORMS") in CI
Gemfile.lock lists the platforms it was solved for in its PLATFORMS section. If the runner platform is not listed, Bundler cannot pick the precompiled native gem for it and either rebuilds from source or fails.
What this error means
bundle install in deployment mode fails because the lockfile has no entry for the runner platform (for example only ruby and arm64-darwin, but the runner is x86_64-linux), so a precompiled gem cannot be resolved.
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 lockfile was generated on a different platform
The lock was solved on macOS or a single platform, so it never recorded x86_64-linux, the platform Linux CI runs on.
A precompiled gem has no fallback for the runner
Gems like nokogiri ship platform-specific builds; without the runner platform listed, Bundler has no installable variant.
How to fix it
Add the runner platform to the lockfile
- Run bundle lock --add-platform for the CI platform.
- Commit the updated Gemfile.lock with the new PLATFORMS entry.
- Re-run CI so the platform-specific gem resolves.
bundle lock --add-platform x86_64-linux
git add Gemfile.lockAdd both common CI platforms
Include the platforms your runners use so the lockfile covers Linux x86 and ARM.
bundle lock --add-platform x86_64-linux aarch64-linuxHow to prevent it
- Add every CI platform to Gemfile.lock with bundle lock --add-platform.
- Generate the lockfile on a machine matching the CI platform when possible.
- Commit the PLATFORMS changes so all runners resolve gems.