0

我在尝试运行vagrant up命令时卡住了。我有这个本地 .box 文件位于我的本地驱动器中并先运行vagrant init,然后添加它。添加似乎很顺利,但是当我尝试vagrant up如下所示运行时,它返回:

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:176:in `split': bad URI(不是 URI?): file:C:/Users/burea1124/Projects/ theirgoods/CUserurea1124Projectstheirgoodstheirgoods_dev_vm.box (URI::InvalidURIError)

显然,看起来我应该在某个地方修复 URI,但我不知道为什么它首先看起来像这样。有人对我如何解决这个问题有任何线索吗?

C:\Users\burea1124\Projects\theirgoods>vagrant box add theirgoods C:\Users\burea1124\Projects\theirgoods\theirgoods_dev_vm.box ==> box: 添加 box 'theirgoods' (v0) for provider: box: Downloading: file ://C:/Users/burea1124/Projects/theirgoods/theirgoods_dev_vm.box box: Progress: 100% (Rate: 500M/s, Estimated time剩余:--:--:--) ==> box: 成功添加'virtualbox' 的 box 'theirgoods' (v0)!

C:\Users\burea1124\Projects\theirgoods> vagrant up
用 'virtualbox' 提供程序启动机器'default'... ==> 默认值:找不到 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 parse'来自 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 map' 来自 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 block in run' 来自 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 run' 来自 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 block in call' 来自 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 call'来自 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:95:in block in finalize_action' 来自 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 block in run' 来自 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 run' 来自 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 call' 来自 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 call' 来自 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 block in run' from 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 block in action' 来自 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 call' 来自 C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:在 action' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/batch_action.rb:82:in 块(2 个级别)中运行'

4

2 回答 2

2

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

config.vm.box = "theirgoods"
于 2014-06-07T07:19:52.453 回答
2

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

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

于 2017-03-20T17:11:02.637 回答