`vagrant box list`返回“格式错误的版本号字符串virtualbox(ArgumentError)”

时间:2015-08-20 08:18:39

标签: vagrant

升级流浪汉版本后,当我运行vagrant box list时出现Malformed version number string virtualbox (ArgumentError)错误:

$ vagrant box list
my_box             (virtualbox, 0)
/opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/version.rb:191:in `initialize': Malformed version number string virtualbox (ArgumentError)
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/box_collection.rb:277:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/box_collection.rb:277:in `block (2 levels) in find'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/box_collection.rb:272:in `map'
...

什么是流浪汉?我该如何解决?

1 个答案:

答案 0 :(得分:1)

虚拟框线的某个地方似乎改变了它们存储盒子版本的方式。他们曾经是名字存储;现在他们按号码存储了。

$ tree -L 2 .vagrant.d/boxes/
.vagrant.d/boxes/
└── my_box
    └── 0           # <-- new format, keep this
    └── virtualbox  # <-- old, offending format

在上述情况下,virtualbox目录是问题 - 要让vagrant box list再次工作,请删除违规版本,如下所示:

rm -rf .vagrant.d/boxes/my_box/virtualbox