vagrant up 时 undefined method `exists?' for class File (NoMethodError)

vagrant up时报错 undefined method `exists?' for class File (NoMethodError)

VERSION
Ubuntu 24.04.2LTS
Vagrant 2.4.3
VirtualBox GUI 7.0.16_Ubuntu

报错信息

该问题是 vagrant 插件vagrant-vbguest的问题,原因是使用了一个弃用的调用
path && File.exists?(path)
卸载该插件后就可以正常启动,如果需要使用该插件可以修改virtualbox.rb(文件位置在报错信息中有),应该是在第84行
或者可以通过本地构建安装vagrant-vbguest
如果通过vagrant plugin install vagrant-vbguest直接安装会从RubyGems获取未维护的 vagrant-vbguest
参考https://github.com/hashicorp/vagrant/issues/13404

posted @ 2025-07-15 15:04  公卿  阅读(33)  评论(0)    收藏  举报