【问题标题】:Sharing Gemfile.lock between JRuby and MRI在 JRuby 和 MRI 之间共享 Gemfile.lock
【发布时间】:2018-10-18 08:13:38
【问题描述】:

我正在开发一个与 JRuby 和 MRI 兼容且无需交叉编译的 gem。我发现在 JRuby changes Gemfile.lock 上运行 bundle install

当我在 MRI 上运行 bundle install 时,Gemfile.lock 不会变回来。但一切都按预期进行。 MRI bundler 没有尝试安装 JRuby 添加的新依赖项。

即使我没有提到,bundler 怎么知道它不应该安装这些?

为 JRuby 和 MRI 使用一个 Gemfile.lock 是否安全?

【问题讨论】:

    标签: ruby rubygems jruby


    【解决方案1】:

    没关系,你想要什么。在 MRI 下重新运行 bundle 就可以了。因此,只需将其提交到 git 中,并在其更改时在两个 Rubies 下重新运行 bundle。

    Bundler 1.16 支持 gem 相对于平台的依赖项(因为某些 gem 可能是原生的),因此请确保您没有使用旧版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-17
      • 1970-01-01
      • 1970-01-01
      • 2013-07-20
      • 2014-05-30
      • 2012-09-12
      • 1970-01-01
      • 2019-05-06
      相关资源
      最近更新 更多