为什么 Heroku 在 Windows 中不接受我的 Gemfile.lock? [英] Why won't Heroku accept my Gemfile.lock in Windows?

查看:18
本文介绍了为什么 Heroku 在 Windows 中不接受我的 Gemfile.lock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a rails application that I deploy on Heroku. I'm using several different machines, and I noticed that when I add new dependencies (so that Gemfile.lock is rebuilt) and do bundle install on my Windows computer at home, push to Heroku fails with the following error:

   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
   ...

Gemfile.lock 受版本控制,但 Heroku 似乎选择忽略它,因为它是在 Windows 中创建的,然后在几秒钟后抱怨它丢失了.为什么会发生这种情况?我该如何解决?

Gemfile.lock IS under version control, but Heroku appearently chooses to ignore it since it's created in Windows, and then complains that it's missing seconds later. Why does this happen? And how can I solve it?

推荐答案

就像 matt 上面评论的一样:

Like matt commented above:

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

The problem is that Bundler creates different Gemfile.locks for Windows. The only solution is to create and commit the lock file on a *NIX system.

我建议创建一个运行例如的虚拟机Ubuntu – 可能使用 Virtual Box.您甚至可以获得随时可用的虚拟机——例如此处.

I would suggest to create a virtual machine running e.g. Ubuntu – maybe using Virtual Box. You can even get ready-to-use virtual machines – for example here.

这篇关于为什么 Heroku 在 Windows 中不接受我的 Gemfile.lock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆