简体   繁体   English

git push heroku master需要永远

[英]git push heroku master takes forever

I'm using a VM based on Ubuntu 12.04 (ruby 1.9.2p290 and rails 3.1.0) and my app work perfectly on local. 我正在使用基于Ubuntu 12.04(红宝石1.9.2p290和rails 3.1.0)的VM,我的应用程序在本地完美运行。 I'm using git and when I try to git push heroku master it doesn't work: 我正在使用git,当我尝试git push heroku master它不起作用:

git push heroku master

I get: "Counting objects: 435, done. Compressing objects: 100% (215/215), done. Writing objects: 100% (435/435), 73.35 KiB, done. Total 435 (delta 171), reused 435 (delta 171) " 我得到:“计数对象:435,完成。压缩对象:100%(215/215),完成。写入对象:100%(435/435),73.35 KiB,完成。总计435(delta 171),重用435( delta 171)“

And it never finish, so it doesn't push anything to heroku. 而且它永远不会完成,因此它不会将任何内容推送到heroku。 The terminal standby forever. 终端永远待命。 I'm new to heroku and git sorry if the question was obvious :) 如果问题很明显,我是heroku和git的新手:)

Operative System information: 操作系统信息:

jobs [1]+ Running git push heroku master & 工作[1] +运行git push heroku master&

ps -x ps -x

PID TTY STAT TIME COMMAND PID TTY STAT时间命令

1078 ? 1078? Ssl 0:00 gnome-session --session=ubuntu SSL 0:00 gnome-session --session = ubuntu

1135 ? 1135? Sl 0:00 /usr/bin/VBoxClient --clipboard Sl 0:00 / usr / bin / VBoxClient-剪贴板

1147 ? 1147? Sl 0:00 /usr/bin/VBoxClient --display Sl 0:00 / usr / bin / VBoxClient-显示

1154 ? 1154年? Sl 0:00 /usr/bin/VBoxClient --seamless Sl 0:00 / usr / bin / VBoxClient-无缝

1162 ? 1162年? Sl 0:19 /usr/bin/VBoxClient --draganddrop Sl 0:19 / usr / bin / VBoxClient --draganddrop

1167 ? 1167? Ss 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-s Ss 0:00 / usr / bin / ssh-agent / usr / bin / dbus-launch --exit-with-s

1171 ? 1171年? S 0:00 /usr/bin/dbus-launch --exit-with-session gnome-sessio S 0:00 / usr / bin / dbus-launch --exit-with-session gnome-sessio

1172 ? 1172? Ss 0:01 //bin/dbus-daemon --fork --print-pid 5 --print-addres SS 0:01 // bin / dbus-daemon --fork --print-pid 5 --print-addres

1246 ? 1246? Sl 0:00 /usr/bin/gnome-keyring-daemon --start --components=se Sl 0:00 / usr / bin / gnome-keyring-daemon --start --components = se

1250 ? 1250? Sl 0:02 /usr/lib/gnome-settings-daemon/gnome-settings-daemon Sl 0:02 / usr / lib / gnome-settings-daemon / gnome-settings-daemon

1329 ? 1329年? S 0:00 /usr/lib/gvfs/gvfsd S 0:00 / usr / lib / gvfs / gvfsd

1334 ? 1334年? Sl 0:00 /usr/lib/gvfs//gvfs-fuse-daemon -f /home/ubuntu/.gvfs Sl 0:00 / usr / lib / gvfs // gvfs-fuse-daemon -f /home/ubuntu/.gvfs

1401 ? 1401吗? Sl 0:03 metacity Sl 0:03变态

1417 ? 1417年? S 0:00 /usr/lib/i386-linux-gnu/gconf/gconfd-2 S 0:00 / usr / lib / i386-linux-gnu / gconf / gconfd-2

1421 ? 1421? S 小号

1426 ? 1426年? Sl 0:01 unity-2d-panel Sl 0:01 unity-2d-panel

1427 ? 1427? Sl 0:07 unity-2d-shell Sl 0:07 unity-2d-shell

1430 ? 1430年? S 0:00 /usr/lib/pulseaudio/pulse/gconf-helper S 0:00 / usr / lib / pulseaudio / pulse / gconf-helper

1447 ? 1447? Sl 0:01 /usr/lib/bamf/bamfdaemon Sl 0:01 / usr / lib / bamf / bamfdaemon

1450 ? 1450年? Sl 0:00 /usr/lib/gnome-settings-daemon/gnome-fallback-mount-h Sl 0:00 / usr / lib / gnome-settings-daemon / gnome-fallback-mount-h

1453 ? 1453? Sl 0:02 nautilus -n Sl 0:02鹦鹉螺-n

1455 ? 1455年? Sl 0:00 /usr/lib/policykit-1-gnome/polkit-gnome-authenticatio Sl 0:00 / usr / lib / policykit-1-gnome / polkit-gnome-authenticatio

1457 ? 1457? Sl 0:00 bluetooth-applet SL 0:00蓝牙小程序

1468 ? 1468吗? Sl 0:00 nm-applet Sl 0:00 nm小程序

1482 ? 1482? S 0:00 /usr/lib/gvfs/gvfs-gdu-volume-monitor S 0:00 / usr / lib / gvfs / gvfs-gdu-volume-monitor

1500 ? 1500? Sl 0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor Sl 0:00 / usr / lib / gvfs / gvfs-afc-volume-monitor

1504 ? 1504年? S 0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor S 0:00 / usr / lib / gvfs / gvfs-gphoto2-volume-monitor

1518 ? 1518年? S 0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.9 /org/gtk/gvf S 0:00 / usr / lib / gvfs / gvfsd-trash --spawner:1.9 / org / gtk / gvf

1521 ? 1521年? Sl 0:01 /usr/lib/unity/unity-panel-service Sl 0:01 / usr / lib / unity / unity-panel-service

1523 ? 1523? Sl 0:00 /usr/lib/dconf/dconf-service Sl 0:00 / usr / lib / dconf / dconf-service

1539 ? 1539? Sl 0:00 /usr/lib/indicator-datetime/indicator-datetime-servic Sl 0:00 / usr / lib / indicator-datetime / indicator-datetime-servic

1541 ? 1541? Sl 0:00 /usr/lib/indicator-printers/indicator-printers-servic Sl 0:00 / usr / lib / indicator-printers / indicator-printers-servic

1543 ? 1543? Sl 0:00 /usr/lib/indicator-messages/indicator-messages-servic Sl 0:00 / usr / lib / indicator-messages / indicator-messages-servic

1545 ? 1545年? Sl 0:00 /usr/lib/indicator-session/indicator-session-service S1 0:00 / usr / lib / indicator-session / indicator-session-service

1547 ? 1547年? Sl 0:00 /usr/lib/indicator-application/indicator-application- Sl 0:00 / usr / lib / indicator-application / indicator-application-

1549 ? 1549年? Sl 0:00 /usr/lib/indicator-sound/indicator-sound-service Sl 0:00 / usr / lib / indicator-sound / indicator-sound-service

1574 ? 1574年? S 0:00 /usr/lib/geoclue/geoclue-master S 0:00 / usr / lib / geoclue / geoclue-master

1591 ? 1591年? S 0:00 /usr/lib/ubuntu-geoip/ubuntu-geoip-provider S 0:00 / usr / lib / ubuntu-geoip / ubuntu-geoip-provider

1597 ? 1597? Sl 0:00 /usr/lib/gnome-disk-utility/gdu-notification-daemon Sl 0:00 / usr / lib / gnome-disk-utility / gdu-notification-daemon

1603 ? 1603年? S 0:00 /usr/lib/gvfs/gvfsd-metadata S 0:00 / usr / lib / gvfs / gvfsd-metadata

1609 ? 1609年? Sl 0:00 /usr/lib/indicator-appmenu/hud-service Sl 0:00 / usr / lib / indicator-appmenu / hud-service

1620 ? 1620年? Sl 0:00 /usr/lib/unity-lens-applications/unity-applications-d Sl 0:00 / usr / lib / unity-lens-applications / unity-applications-d

1622 ? 1622年? Sl 0:00 /usr/lib/unity-lens-files/unity-files-daemon Sl 0:00 / usr / lib / unity-lens-files / unity-files-daemon

1624 ? 1624年? Sl 0:00 /usr/lib/unity-lens-music/unity-music-daemon Sl 0:00 / usr / lib / unity-lens-music / unity-music-daemon

1626 ? 1626年? Sl 0:00 /usr/bin/python /usr/lib/unity-lens-video/unity-lens- Sl 0:00 / usr / bin / python / usr / lib / unity-lens-video / unity-lens-

1653 ? 1653年? Sl 0:00 /usr/bin/zeitgeist-daemon Sl 0:00 / usr / bin / zeitgeist-daemon

1661 ? 1661年? Sl 0:00 telepathy-indicator Sl 0:00心灵感应指示器

1668 ? 1668年? Sl 0:00 /usr/lib/zeitgeist/zeitgeist-fts Sl 0:00 / usr / lib / zeitgeist / zeitgeist-fts

1672 ? 1672年? Sl 0:00 zeitgeist-datahub Sl 0:00 Zeitgeist-datahub

1676 ? 1676年? S 0:00 /bin/cat 小0:00 / bin / cat

1682 ? 1682年? Sl 0:00 /usr/lib/telepathy/mission-control-5 Sl 0:00 / usr / lib / telepathy / mission-control-5

1701 ? 1701吗? Sl 0:00 gnome-screensaver Sl 0:00 gnome屏幕保护程序

1703 ? 1703年? Sl 0:00 /usr/bin/python /usr/lib/unity-scope-video-remote/uni Sl 0:00 / usr / bin / python / usr / lib / unity-scope-video-remote / uni

1728 ? 1728年? Sl 0:05 gnome-terminal Sl 0:05 gnome-terminal

1734 ? 1734年? S 0:00 gnome-pty-helper S 0:00 gnome-pty-helper

1738 pts/2 Ss 0:00 bash 1738 pts / 2 Ss 0:00 bash

1796 ? 1796年? Sl 0:00 update-notifier Sl 0:00更新通知程序

1954 pts/2 S 0:00 git push heroku master 1954 pts / 2 S 0:00 git push heroku master

1955 pts/2 S 0:00 ssh git@heroku.com git-receive-pack 'polar-island-471 1955 pts / 2 S 0:00 ssh git@heroku.com git-receive-pack'polar-island-471

1959 pts/2 R+ 0:00 ps -x 1959点/ 2 R + 0:00 ps -x

There are many reasons why your push to Heroku can timeout. 推送到Heroku可以超时的原因有很多。 In my experience, the most common reason is due to site size, and by site size, I mean 3 things: the size of your git repo, the size of your site that gets pushed to Heroku (git repo - ignored files), and the size of the gems you use. 根据我的经验,最常见的原因是由于网站大小和网站大小,我的意思是3件事:你的git仓库的大小,你的网站大小被推送到Heroku(git repo - 被忽略的文件),以及您使用的宝石的大小。 Heroku is not particularly robust when it comes to accommodating big sites (or long running processes, for that matter) and if you get too big, you can cause your push to hang / timeout and intermittently too, which can be perplexing. Heroku在容纳大型站点(或者长时间运行的进程)方面并不是特别强大,如果你变得太大,你可能会导致你的推送暂停/超时和间歇性,这可能是令人困惑的。

.git folder I have had the site get unexplainably large and saw that over time my .git folder in the root of the project had grown to 600mb. .git文件夹我让网站变得无法解释地大,并且随着时间的推移,我看到项目根目录中的.git文件夹已经增长到600mb。 Thank goodness I noticed a warning in the heroku deploy chatter that warned me that my git repo was too large. 谢天谢地,我在heroku部署聊天中注意到一个警告,警告我git repo太大。 Anyway, since that folder is managed by git behind the scenes, I ended up starting a fresh git repo and moving my code over to it, which shrunk my site by 90%. 无论如何,由于该文件夹是由git在后台管理的,所以我最终开始了一个新的git repo并将代码移到该文件夹​​中,这使我的网站缩小了90%。

.slugignore Another pitfall that caused my site to become large enough to timeout was allowing things like logs, my temp directory, and my solr indexing directory to be included in the project. .slugignore导致我的站点变得足够大以至于超时的另一个陷阱是允许将日志,临时目录和solr索引目录等内容包含在项目中。 After I excluded all of those folders in my .slugignore file, pushing became very fast. 在我的.slugignore文件中排除了所有这些文件夹后,推送变得非常快。 And yes, you could get the same basic effect using .gitignore, but there are some things that I like to manage through git, but ignore when pushing to heroku. 是的,你可以使用.gitignore获得相同的基本效果,但有些东西我喜欢通过git管理,但在推送到heroku时会忽略。 That's when the .slugignore comes in handy. 那时候.slugignore派上用场了。

gems By completing the steps above, I reduced my site to a reasonable size, but still had occasional timeouts. gems通过完成上述步骤,我将网站缩小到合理的大小,但偶尔也会超时。 Then I realized that gems contribute to your site size too. 然后,我意识到宝石也对您的网站规模有所贡献。 So I removed a handful of unused gems from my gemfile, and I was able to reduce my slug compile time from 900+ seconds to 250 seconds and my overall deployment time from 15+ minutes with frequent timeouts to under 10 minutes. 所以我从我的gemfile中删除了一些未使用的宝石,并且我能够将我的slug编译时间从900秒减少到250秒,并且我的总体部署时间从15分钟以上,频繁超时到10分钟以下。 What a relief to not have to wait so long for each deploy and risk timing out half the time. 对于每次部署而言不必等待这么长时间并且冒出一半时间的风险超时,这是多么轻松。

Depending on your particular setup, any or all of these factors can really hurt you. 根据您的特定设置,所有这些因素中的任何一个或全部都可能确实伤害您。 In my case I was doing everything wrong. 就我而言,我做错了一切。 However, even if you are not timing out, you may still want to prune your site as much as possible to cut down your deployment time. 但是,即使您没有超时,您仍可能希望尽可能地修剪您的网站以缩短部署时间。

how to make heroku not suck http://www.stormconsultancy.co.uk/blog/development/6-ways-to-get-more-bang-for-your-heroku-buck-while-making-your-rails-site-super-snappy/ 如何使heroku不吮吸 http://www.stormconsultancy.co.uk/blog/development/6-ways-to-get-more-bang-for-your-heroku-buck-while-making-your-rails-现场超活泼的/

The reason was, that my connection was very slow. 原因是,我的连接非常慢。 It was the Access Point of my smartphone. 那是我的智能手机的接入点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM