Skip to content

Bundler fails to resolve native gems with -linux platform suffix on Ruby 4 #9686

Description

@asmrtfm

Summary

On Ruby 4.0.x, bundle install fails to resolve native gems that use the -linux platform suffix (e.g. x86_64-linux, aarch64-linux). Bundler appears to expect -linux-gnu or -linux-musl variants that these gems don't publish.

This affects any native gem using the standard rake-compiler platform names — for example, tailwindcss-ruby < 4.0.

Context

The tailwindcss-ruby maintainer confirmed this is likely a Bundler issue, not something individual gems should work around:

If bundler has -- surprisingly -- stopped supporting -linux platform suffixes then it's mostly likely a bundler bug that we should fix, not something that every gem should be reconfigured to work around.

See: flavorjones/tailwindcss-ruby#126

The rake-compiler-dock docs describe the expected behavior: https://github.com/rake-compiler/rake-compiler-dock#linux-gnu-and-musl

To reproduce

  1. Use Ruby 4.0.x
  2. gem "tailwindcss-ruby", "< 4.0" in a Gemfile
  3. bundle install

Bundler fails to find a gem matching the local platform.

Workaround

Adding explicit -linux-gnu and -linux-musl entries to the gem's NATIVE_PLATFORMS hash resolves the issue, but this shouldn't be necessary per the rake-compiler-dock contract.

Environment

  • Ruby: 4.0.5
  • Bundler: 2.5.23 / 4.0.10
  • Platform: x86_64-linux
  • OS: Linux 6.8.0-124-generic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions