为什么Heroku不会在Windows中接受我的Gemfile.lock?

mra*_*ers 12 ruby windows ruby-on-rails heroku

我有一个我在Heroku上部署的rails应用程序.我正在使用几台不同的机器,我注意到当我添加新的依赖项(以便Gemfile.lock重建)并bundle install在我家的Windows计算机上执行时,推送到Heroku失败并出现以下错误:

   Unresolved dependencies detected; Installing...
   Windows Gemfile.lock detected, ignoring it.
   You have modified your Gemfile in development but did not check
   the resulting snapshot (Gemfile.lock) into version control
   ...
Run Code Online (Sandbox Code Playgroud)

Gemfile.lock在版本控制下,Heroku显然选择忽略它,因为它是在Windows中创建的,然后抱怨它在几秒钟后丢失.为什么会这样?我该如何解决?

jer*_*rth 24

我通过打开Gemfile.lock并删除以下两行来修复我的问题:

PLATFORMS
  x86-mingw32
Run Code Online (Sandbox Code Playgroud)

所以现在我只需要创建一个捆绑的脚本然后从锁定文件中删除它.

  • 对于潜入Gemfile.lock的任何Windows版本的宝石,也值得一看.(例如......- x86-mingw32) (3认同)

Kor*_*tor 9

像matt上面评论的:

问题是Bundler Gemfile.lock为Windows 创建了不同的s.唯一的解决方案是在*NIX系统上创建和提交锁定文件.

我建议创建一个运行例如Ubuntu的虚拟机- 也许使用Virtual Box.您甚至可以使用现成的虚拟机 - 例如此处.

  • 真的没有别的办法吗?这太荒谬了.Heroku的人至少应该在他们的文档中有这个.我找不到任何关于它的东西.非常感谢您的回答 - 它清理了一切! (3认同)