You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docker setup on Apple silicon: bundle install step breaks Rails boot (Could not find nokogiri-1.19.7-x86_64-linux-musl) #7439
What happened
Following doc/DOCKER.md (manual setup) on an arm64 Mac (Docker 29.9.3):
docker compose build succeeds (very slow: docker-compose.yml pins platform: linux/x86_64, so everything runs under Rosetta).
docker compose run --rm web bundle install (step 4) completes, but adds an x86_64-linux-musl platform to Gemfile.lock (nokogiri, google-protobuf, pg, prism).
The next command (rails db:reset) and docker compose up fail with Bundler::GemNotFound: Could not find nokogiri-1.19.7-x86_64-linux-musl in locally installed gems.
Likely cause
The Dockerfile runs bundle config set force_ruby_platform true only in the build stage, and the final image doesn't keep that setting. The step-4 install then fetches precompiled musl gems, which Bundler can't resolve at runtime.
Workaround
Skip step 4, because the image already contains the gems. Revert the changed Gemfile.lock with git checkout Gemfile.lock. Bundler also rewrites the lockfile whenever it loads in the container, so it shows as modified.
Suggested fixes (any)
Drop bundle install from doc/DOCKER.md, or note that it isn't needed after docker compose build.
Set BUNDLE_FORCE_RUBY_PLATFORM=true in the final image or in config/docker.env.
Happy to open a PR for whichever approach maintainers prefer. I haven't confirmed whether this affects Intel Macs or Linux.
Activity
compwron commentedon Nov 20, 2026
yes please PR