无法通过cygwin运行vagrant命令

时间:2016-06-23 10:20:08

标签: windows cygwin vagrant homestead

出于某种原因,我无法通过cygwin运行任何流浪命令。虽然通过简单的命令行(cmd)运行它们时一切正常。

通过cygwin时,我收到了这样的错误:

$ vagrant halt
I:/selfwork/Homestead/scripts/homestead.rb:4:in `configure': undefined method `[]' for nil:NilClass (NoMethodError)
        from I:/selfwork/Homestead/Vagrantfile:28:in `block in <top (required)>'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `call'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `load'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `each'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `block in load'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `each'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `load'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:28:in `initialize'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `new'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `vagrantfile'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:486:in `host'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:208:in `block in action_runner'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `call'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `run'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:473:in `hook'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:722:in `unload'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `ensure in <main>'
        from C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `<main>'

但在homestead.rb中,第4行没什么特别的:

1 class Homestead
2   def Homestead.configure(config, settings)
3     # Set The VM Provider
4     ENV['VAGRANT_DEFAULT_PROVIDER'] = settings["provider"] ||= "virtualbox"

Vagrantfile的第28行是对configure的简单调用:

28    Homestead.configure(config, settings)

同样,一切都通过简单的命令行完成。

以前我在cygwin使用vagrant但在Windows 7上没有任何问题。目前我尝试在Windows 10上使用它。

也许我错过了任何特殊选项?

这是cygwin

的全新安装

0 个答案:

没有答案