1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00
Files
til/ruby/add-linux-as-a-bundler-platform.md
2021-02-21 18:26:14 -06:00

920 B

Add Linux As A Bundler Platform

With a locally developed Ruby project on Mac OSX, I have darwin specified as the platform in the Gemfile.lock.

PLATFORMS
  x86_64-darwin-19

When setting up CI for my project on a linux container, I'd get an error like this:

Your bundle only supports platforms ["x86_64-darwin-19"] ...

This platform incompatability can be solved with by adding linux as a platform and re-resolving the lock file. This is done with bundle lock and the --add-platform flag.

$ bundle lock --add-platform x86_64-linux

If all existing gems work with the new linux platform, the command will succeed and the updated Gemfile.lock will have the following PLATFORMS section.

PLATFORMS
  x86_64-darwin-19
  x86_64-linux

source