我正在尝试使用以下方法将我的应用程序推送到heroku:git push heroku master
该过程运行良好一段时间,然后吐出我以前从未见过的各种错误,我在 google 上找不到太多帮助。
这是控制台的错误日志:
XXXXX-MacBook-XXXXXX xxxx$ git push heroku master
Counting objects: 7885, done.
Delta compression using up to 4 threads.
git(237,0xb0185000) malloc: *** mmap(size=81125376) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
warning: suboptimal pack - out of memory
git(237,0xb0185000) malloc: *** mmap(size=93798400) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
git(237,0xb0185000) malloc: *** mmap(size=93798400) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
fatal: Out of memory, malloc failed (tried to allocate 93797389 bytes)
error: pack-objects died with strange error
error: failed to push some refs to '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="70171904301815021f1b055e131f1d" rel="noreferrer noopener nofollow">[email protected]</a>:xxxxx-xxx-xx.git'
有人知道这一切意味着什么以及为什么会发生吗?
此外,我注意到我的: /Users/xxxxxx/Sites/xxxxxx/.git/objects 文件夹有 700+ 兆,不确定这是否正常,因为我是 Rails 和 github 的新手。
感谢您的帮助。
最佳答案
大部分问题的解决都在上面的注释中;当我们开始聊天时,事情已经基本解决了。这是一个答案,只是为了帮助解决问题。
存储库中似乎存在一些未知问题,导致对象目录增长失控。我们实际上并不需要确定这是什么,因为所有提交都已被推送到 github 存储库。只需从那里重新克隆(DVCS 提供免费备份万岁)就可以创建一个完美的存储库来替换旧的存储库。
这个故事的寓意:如果您的 .git 目录是内容大小的 20 倍,并且它在日常操作期间导致 malloc/mmap 失败,则您的存储库可能有问题。
关于ruby-on-rails - Rails + git + heroku - git 推送时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4201698/