2014-04-25 83 views
30

vagrantup.com说输入vagrant box add hashicorp/precise32

但是当我输入它,端子输出错误信息:命令“流浪汉框添加”失败

This command was not invoked properly. The help for this command is 
available below. 

Usage: vagrant box add <name> <url> [--provider provider] [-h] 

然后,我输入vagrant box add hashicorp/precise32 \ http://files.vagrantup.com/hashicorp/precise32.box
但下载失败,与以下错误消息。

Download failed. Will try another box URL if there is one. 
An error occurred while downloading the remote file. The error 
message, if any, is reproduced below. Please fix this error and try 
again. 

Couldn't open file /Users/XXXX/ http:/files.vagrantup.com/precise32.box 

我该如何安装vagrant box?

回答

42

由于Vagrant Cloud的介绍,vagrant box add子命令的语法随版本1.5而改变。

从输出消息看来,您使用的是旧版本,因此当前文档对您的情况不可靠。

Here你可以找到旧文档的快照,在任何情况下,你需要使用的语法是这样的:

vagrant box add precise32 http://files.vagrantup.com/precise32.box 
+1

真棒感谢,让我停留了一段时间。最后,我更新了我的流浪汉版本,修复了它http://www.vagrantup.com/downloads.html –

+1

我刚刚尝试了这个,并为您的网址获得了404。尽管如此,http:// files.vagrantup.com/precise32.box也适用于我。 – Kietz

+0

@Kietz我用工作网址 –