为 gem 的特定版本设置 Bundler 配置

Set Bundler config for specific version of a gem

我想使用 Bundler 安装旧版本的 Puma gem。基于 this comment in GitHub,我能够确定它需要 --with-opt-include=/usr/local/opt/openssl/include 才能工作。

我想在每次安装此 gem 时都使用该选项。我知道我可以将它添加到 bundle config...

bundle config build.puma -- --with-opt-include=/usr/local/opt/openssl/include

...但我只想将其应用于 Puma v2.9.0。这可能吗?

您尝试过以下方法吗?

gem install puma -v '2.9.0' -- --with-opt-include=/usr/local/opt/openssl/include

bundle config build.puma /path/to/local/git/puma/2.9.0 -- --with-opt-include=/usr/local/opt/openssl/include