无法在Windows 7上使用Vagrant运行本地机箱VM - 错误的URI错误

时间:2014-06-06 21:02:30

标签: vagrant vagrantfile

当我试图运行vagrant up命令时,我陷入困境。我将这个本地.box文件放在我的本地驱动器中,然后拳头运行vagrant init,然后添加它。添加似乎没问题,但是当我尝试运行vagrant up时,如下所示,它返回:

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:176:在`split'中:错误的URI(不是URI?):file:C:/用户/ burea1124 / Projects / theirgoods / CUserurea1124Projectstheirgoodstheirgoods_dev_vm.box(URI :: InvalidURIError)

显然看起来我应该在某处修复URI,但我不知道为什么它首先看起来像那样。有没有人知道如何解决这个问题呢?

  

C:\ Users \ burea1124 \ Projects \ theirgoods> vagrant box add theirgoods   C:\ Users \用户burea1124 \项目\ theirgoods \ theirgoods_dev_vm.box   ==>框:为提供者添加“他们的好”(v0)框:       box:正在下载:file:// C:/Users/burea1124/Projects/theirgoods/theirgoods_dev_vm.box       方框:进度:100%(速率:500M / s,预计剩余时间: - : - : - )   ==>框:已成功为'virtualbox'添加了'他们的好'(v0)框!

     

C:\用户\ burea1124 \项目\ theirgoods>流浪汉   瞻   机器'默认'与'virtualbox'提供商...   ==>默认值:Box'CUserurea1124Projectstheirgoodstheirgoods_dev_vm.box'不可能是   找到。试图找到并安装......       默认值:Box Provider:virtualbox       默认值:Box版本:> = 0 C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:176:in   split': bad URI(is not URI?): file:C:/Users/burea1124/Projects/theirgoods/CUserurea1124Projectstheirgoodstheirgoods_dev_vm.box (URI::InvalidURIError) from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:211:in 解析”           来自C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:747:in   parse' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/box_add.rb:458:in metadata_url?           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/box_add.rb:77:in   block in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/box_add.rb:75:in 映射”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/box_add.rb:75:in:   call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in 称之为”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in   call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in 阻止运行'           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in:   busy' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in 运行”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle_box.rb:79:in   handle_box' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle_box.rb:42:in 阻止通话'           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle_box.rb:36:in:   synchronize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle_box.rb:36:in 称之为”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in:   在finalize_action中阻止call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:in           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in:   call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in 称之为”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in   call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in 阻止运行'           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in:   busy' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in 运行”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.rb:53:in:   call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in 称之为”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in:   call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in 称之为”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in   call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in 阻止运行'           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in:   busy' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in 运行”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:196:in   action_raw' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:173:in 阻止行动'           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in   lock' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in 称之为”           来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in   运行'

action' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/batch_action.rb:82:in 阻止(2个级别)

2 个答案:

答案 0 :(得分:2)

您的Vagrantfile似乎在引用带有完整路径的框时,您必须改为使用框名称:

config.vm.box = "theirgoods"

答案 1 :(得分:2)

这是我搜索该错误时的首要问题。在我的情况下的问题是我正确地添加了框,但我复制了现有的Vagrantfile而忘记了vagrant init

因此对于有此错误的其他人,请确保您正在执行vagrant init:)