Bundler: is there a way to only install a gem on x86_64-linux? #7487
Replies: 2 comments
-
It sounds like this might be an argument for extending the Gemfile |
Beta Was this translation helpful? Give feedback.
-
This is exactly the problem I was running into that prompted #7172 (in which you'll also find some discussion and links to the specific problems). This is certainly a problem that others are seeing. I believe Homebrew is experiencing it with the sorbet gem, or really anyone that uses the sorbet gem will see this because it doesn't have a ruby platform version. Going back a few versions in bundler allows this to work because we used to allow "invalid" platforms to stay in the Gemfile.lock. |
Beta Was this translation helpful? Give feedback.
-
I have a problem with Dependabot where it successfully updates gems but removes the arm64-darwin platform in the process. I’m trying to reduce it down to a minimal test case but am struggling to reproduce the exact behaviour that I can see in the Dependabot PRs.
Now a vital detail. The offending gem is mqlight (which appears to be abandonware but is sadly required by the project) which only provides platform-specific versions and does not include a version for arm64-darwin.
Up until bundler version 2.4.20 it’s been possible to use:
Which allows
bundle install
to work on an Apple Silicon Mac so it doesn’t attempt to install the gem, the Gemfile.lock is generated correctly (from my point of view at least) including the arm64-darwin platform and platform-specific gems, and the mqlight gem is installed on both CI and production environments because they are both x86_64-linux.But when I (locally on arm64-darwin) attempt to upgrade bundler using
bundle update --bundler
I get the error:If I remove the arm64-darwin platform and then try to update bundler I get the same message presumably because it’s trying to helpfully re-add the platform. I’m pretty stuck (on bundler version 2.4.20).
Is there a way to tell bundler that I only want to install mqlight on x86_64-linux? Using the
platforms
option in the Gemfile seems the right place but it doesn’t seem to be related toRUBY_PLATFORM
?Beta Was this translation helpful? Give feedback.
All reactions