启动Homestead总是报错Too many open files - getcwd (Errno::EMFILE)
环境
操作系统:macOS 10.14.6
虚拟机:VirtualBox 6.1
vagrant 2.2.14
Homestead box 是教程提供的定制镜像 lc-homestead-8.2.1-2019112300
终端iTerm2
本人小菜鸟一个,最近接连学习了 Laravel 课程01
02
03
。
前两课都没问题,学到第三课的时候经常出现 vagrant up 的时候会卡很久的情况,后来甚至直接报错
Too many open files - getcwd (Errno::EMFILE)
完整报错:
homestead-7: Warning: Remote connection disconnect. Retrying...
Traceback (most recent call last):
25: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'
24: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/communicators/ssh/communicator.rb:63:in `wait_for_ready'
23: from /opt/vagrant/embedded/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
22: from /opt/vagrant/embedded/lib/ruby/2.6.0/timeout.rb:33:in `catch'
21: from /opt/vagrant/embedded/lib/ruby/2.6.0/timeout.rb:33:in `catch'
20: from /opt/vagrant/embedded/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
19: from /opt/vagrant/embedded/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
18: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/communicators/ssh/communicator.rb:87:in `block in wait_for_ready'
17: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/communicators/ssh/communicator.rb:399:in `connect'
16: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/machine.rb:450:in `ssh_info'
15: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/provider.rb:78:in `ssh_info'
14: from /opt/vagrant/embedded/lib/ruby/2.6.0/forwardable.rb:230:in `ssh_port'
13: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/driver/version_5_0.rb:837:in `ssh_port'
12: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/driver/version_5_0.rb:504:in `read_forwarded_ports'
11: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/driver/base.rb:398:in `execute'
10: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/retryable.rb:17:in `retryable'
9: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/driver/base.rb:403:in `block in execute'
8: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/driver/base.rb:465:in `raw'
7: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/busy.rb:19:in `busy'
6: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/driver/base.rb:466:in `block in raw'
5: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:22:in `execute'
4: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:154:in `execute'
3: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:24:in `safe_chdir'
2: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:24:in `synchronize'
1: from /opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:25:in `block in safe_chdir'
/opt/vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:25:in `chdir': Too many open files - getcwd (Errno::EMFILE)
尝试了删除虚拟机,重新导入 Box ,第一次启动没问题,后来又是同样的错误。
尽力在网上也没查到有类似的问题。
请问社区各位大神有没有思路?
本地ulimit 调大点
升级vagrant,VirtualBox试一试。