Vagrant Up Throws Undefined Method Error
Issue:
Seeing the following error when running ‘vagrant up’ on single-instance oracle vagrant file
1
undefined method `exists?' for class File (NoMethodError)
Cause:
Small but critical Ruby API change. Ruby’s File.exists? method has been deprecated for years and was removed in Ruby 3.2+.
✅ Correct method:
1
File.exist?
❌ But the vagrant-vbguest plugin being used is calling the old method:
1
File.exists?
So the plugin fails when it tries to check for a file.
Solution:
Manually patch the line that throws the error:
- open the file
1
C:/Users/your_user/.vagrant.d/gems/3.3.8/gems/vagrant-vbguest-0.32.0/lib/vagrant-vbguest/hosts/virtualbox.rb
- Find and change line 84
1 2
- path && File.exists?(path) + path && File.exist?(path)
- Save the file and rerun
vagrant up.
This post is licensed under CC BY 4.0 by the author.
