Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Bundler说它在部署期间内存不足_Ruby On Rails_Git_Capistrano_Bundler - Fatal编程技术网

Ruby on rails Bundler说它在部署期间内存不足

Ruby on rails Bundler说它在部署期间内存不足,ruby-on-rails,git,capistrano,bundler,Ruby On Rails,Git,Capistrano,Bundler,我的部署失败,无法分配内存-git。完全回溯: DEBUG [5e6f2497] fatal: Not a git repository (or any of the parent directories): .git DEBUG [5e6f2497] Unfortunately, a fatal error has occurred. Please see the Bundler DEBUG [5e6f2497] troubleshooting documentation a

我的部署失败,无法分配内存-git。完全回溯:

DEBUG [5e6f2497]    fatal: Not a git repository (or any of the parent directories): .git
DEBUG [5e6f2497]    Unfortunately, a fatal error has occurred. Please see the Bundler
DEBUG [5e6f2497]    troubleshooting documentation at http://<censored>/bundler-issues. Thanks!
DEBUG [5e6f2497]    /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in ``': Cannot allocate memory - git
DEBUG [5e6f2497]     (Errno::ENOMEM)
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in `git'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:105:in `block in has_revision_cached?'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:130:in `chdir'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:130:in `in_path'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:105:in `has_revision_cached?'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:39:in `checkout'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git.rb:144:in `specs'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/lazy_specification.rb:52:in `__materialize__'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:88:in `block in materialize'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/bin/bundle:23:in `load'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@global/bin/bundle:23:in `<main>'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@staging/bin/ruby_executable_hooks:15:in `eval'
DEBUG [5e6f2497]        from /home/deploy/.rvm/gems/ruby-2.0.0-p353@staging/bin/ruby_executable_hooks:15:in `<main>'
cap aborted!
以及部署崩溃前资源的外观:

top - 14:26:47 up 104 days, 11:56,  1 user,  load average: 0.57, 0.23, 0.19
Tasks: 147 total,   2 running, 145 sleeping,   0 stopped,   0 zombie
%Cpu(s): 12.5 us,  0.0 sy,  0.0 ni, 87.0 id,  0.4 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   1007920 total,   993468 used,    14452 free,      648 buffers
KiB Swap:   524284 total,   323304 used,   200980 free,    72480 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
31992 deploy    20   0  453m 384m 1816 R 100.1 39.0   0:55.69 ruby
    1 root      20   0 27100  216    0 S   0.0  0.0   0:29.17 init
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd
正如你所看到的,还有很多记忆。我还尝试升级我的捆绑包版本:

 ~/dimsum-v2 ⮀ master● ⮀ 24m ⮀ bundler -v       ⮂ ruby-2.0.0-p643
Bundler version 1.11.2

还有什么我应该尝试的吗?

14mb的可用内存对我来说并不多。@tpbowden:所以它根本不会使用交换,当它达到零物理内存时就会死掉?我想这取决于你的操作系统,但无论哪种方式,使用交换都是一个坏主意,它不仅会对正在运行的进程,而且会对整个操作系统产生巨大的性能影响。您可能应该尝试清理一些进程或获取更多的RAM14mb的可用内存对我来说并不足够。@tpbowden:所以它根本不会使用交换,当物理内存为零时就会死掉?我认为这取决于您的操作系统,但无论哪种方式,使用交换都是一个坏主意,它不仅会对正在运行的进程,而且会对整个操作系统产生巨大的性能影响。您可能应该尝试清理一些进程或获得更多RAM
 ~/dimsum-v2 ⮀ master● ⮀ 24m ⮀ bundler -v       ⮂ ruby-2.0.0-p643
Bundler version 1.11.2