【问题标题】:Vagrant fork() function is unimplemented on this machine (NotImplementedError) on WindowsVagrant fork() 函数在 Windows 上的这台机器上未实现 (NotImplementedError)
【发布时间】:2017-07-11 05:57:48
【问题描述】:

Windows 10。

运行vagrant up时,出现以下错误:

==> centos: Destroying VM and associated drives...
C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/daemonize.rb:10:in `fork': fork() function is unimplemented on this machine (NotImplementedError)
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/daemonize.rb:10:in `safefork'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/daemonize.rb:45:in `call_as_daemon'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/application.rb:270:in `start_proc'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/application.rb:296:in `start'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/controller.rb:56:in `run'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons.rb:197:in `block in run_proc'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/cmdline.rb:92:in `call'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons/cmdline.rb:92:in `catch_exceptions'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/daemons-1.2.4/lib/daemons.rb:196:in `run_proc'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/vagrant-dns-1.1.0/lib/vagrant-dns/service.rb:26:in `run!'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/vagrant-dns-1.1.0/lib/vagrant-dns/service.rb:17:in `start!'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/vagrant-dns-1.1.0/lib/vagrant-dns/service.rb:52:in `restart!'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/vagrant-dns-1.1.0/lib/vagrant-dns/restart_middleware.rb:14:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/plugins/providers/virtualbox/action/check_guest_additions.rb:49:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/vagrant-vbguest-0.13.0/lib/vagrant-vbguest/middleware.rb:31:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/Users/hi/.vagrant.d/gems/2.2.5/gems/vagrant-proxyconf-1.5.2/lib/vagrant-proxyconf/action/only_once.rb:33:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/plugins/providers/virtualbox/action/customize.rb:40:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/builtin/wait_for_communicator.rb:71:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.2/plugins/providers/virtualbox/action/customize.rb:40:in `call'

我试图从 GitHub 问题中找到一些解决方案: https://github.com/vagrant-landrush/landrush/issues/16

不知道。

也试过安装这个:

gem install win32-process

同样的结果。

所以我不知道真正的问题。

【问题讨论】:

  • 我有点困惑,你是想从 Windows 运行这段代码吗?因为我很确定 fork 在 Windows 上不起作用,这就是您收到此错误的原因。
  • @Thermatix 所以流浪汉不能在 Windows 上正常工作?
  • 不,应该没问题,因为我之前在 windows 上使用过,您可能需要进行不同的配置。
  • @Thermatix 我不记得有配置的东西。只是现在不知道如何解决。
  • 我看到你安装了vagrant-dns 插件,其他一些人报告说卸载它可以解决问题。

标签: ruby windows vagrant


【解决方案1】:

据报道,vagrant-dns 插件可能会在 Windows 上导致此问题。如果已安装,请尝试将其卸载。

如果这不是一个选项,Windows 10 具有您可以安装的适用于 Linux 的 Windows 子系统功能。这将允许您利用 Windows 商店中的 Unix Distro 应用程序之一来安装 bash shell。这将允许您在 Linux 环境中运行您的应用程序,有效地启用 Fork()

【讨论】:

    猜你喜欢
    • 2015-09-02
    • 1970-01-01
    • 1970-01-01
    • 2015-11-04
    • 2017-09-18
    • 2018-09-30
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多