Skip to content

Docker setup on Apple silicon: bundle install step breaks Rails boot (Could not find nokogiri-1.19.7-x86_64-linux-musl) #7439

Open

Description

@VickTor61

What happened
Following doc/DOCKER.md (manual setup) on an arm64 Mac (Docker 29.9.3):

  1. docker compose build succeeds (very slow: docker-compose.yml pins platform: linux/x86_64, so everything runs under Rosetta).
  2. 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).
  3. 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

  1. compwron commented on Nov 20, 2026

    @compwron
    Collaborator

    yes please PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions