我曾经用流浪者启动我的本地 VM gc-gw0
:
vagrant up gc-gw0
但从今天开始,我反而收到此错误:
/usr/lib/ruby/2.1.0/rubygems/version.rb:202:in `initialize':
Malformed version number string .git (ArgumentError)
from /usr/lib/ruby/2.1.0/rubygems/version.rb:192:in `new'
from /usr/lib/ruby/2.1.0/rubygems/version.rb:192:in `new'
from /usr/lib/ruby/vendor_ruby/vagrant/box_collection.rb:274:in `block (2 levels) in find'
from /usr/lib/ruby/vendor_ruby/vagrant/box_collection.rb:271:in `map'
from /usr/lib/ruby/vendor_ruby/vagrant/box_collection.rb:271:in `block in find'
from /usr/lib/ruby/vendor_ruby/vagrant/box_collection.rb:423:in `block in with_collection_lock'
from /usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /usr/lib/ruby/vendor_ruby/vagrant/box_collection.rb:422:in `with_collection_lock'
from /usr/lib/ruby/vendor_ruby/vagrant/box_collection.rb:264:in `find'
from /usr/lib/ruby/vendor_ruby/vagrant/vagrantfile.rb:157:in `block in machine_config'
from /usr/lib/ruby/vendor_ruby/vagrant/vagrantfile.rb:190:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/vagrantfile.rb:190:in `machine_config'
from /usr/lib/ruby/vendor_ruby/vagrant/vagrantfile.rb:45:in `machine'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:503:in `machine'
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:168:in `block in with_target_vms'
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:192:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:192:in `block in with_target_vms'
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:174:in `each'
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:174:in `with_target_vms'
from /usr/share/vagrant/plugins/commands/up/command.rb:67:in `block in execute'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:239:in `block (2 levels) in batch'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:237:in `tap'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:237:in `block in batch'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:236:in `synchronize'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:236:in `batch'
from /usr/share/vagrant/plugins/commands/up/command.rb:58:in `execute'
from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:42:in `execute'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:258:in `cli'
from /usr/bin/vagrant:173:in `<main>'
奇怪的是,我昨天还是这样开始的,没有问题。
我搜索了很多这个错误,但还没有提示。此错误消息是什么意思?整个消息中的主要错误是什么?
我使用
$ vagrant -v
Vagrant 1.6.5
$ ruby -v
ruby 2.1.2p95 (2014-05-08) [i386-linux-gnu]
Vagrantfile 和 bootstrap-testnode.sh 文件在这里:rubo77/freifunk-gluon-example-node
但是我删除了 virtualbox 中的所有 vm,但每当我想对流浪者做任何事情时,我仍然会收到此错误。似乎流浪汉本身就有一些问题。所以我想我尝试的脚本与此错误无关。
/usr/lib/ruby/2.1.0/rubygems/version.rb
中的第 202 行是这样的:
def initialize version
raise ArgumentError, "Malformed version number string #{version}" unless
self.class.correct?(version)
@version = version.to_s.strip.gsub("-",".pre.")
@segments = nil
end
所以看起来 ruby 正在检查 .git 文件夹而不是版本号文件夹
我发现:
我在里面创建了一个.git
存储库
~/.vagrant.d/boxes/box-cutter-VAGRANTSLASH-debian77-i386
所以流浪汉试图阅读那个文件夹,那里应该只有用数字命名的文件夹。
我删除了那个.git
文件夹,它可以工作
我遇到了类似的流浪者配置错误。
出于某种原因,在更新流浪文件的特定配置上的存储库时,这可能会弄乱流浪者框。就我而言,我正在升级流浪者和虚拟盒子,并对流浪者文件进行了其他一些更改。
我不得不去
~/.vagrant.d/boxes/
并擦掉我拥有的旧盒子。