Created
June 5, 2025 05:48
-
-
Save AW-Britt/4d412ec308f5890c9bd68756f13bfef4 to your computer and use it in GitHub Desktop.
Workaround vagrant-vbguest plugin fail due to NoSuchMethod error on `File.exists?`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Place this blurb at the top of your Vagrantfile to allow the unpatched | |
| # version of the Vagrant vagrant-vbguest plugin to properly execute | |
| # in newer Ruby environments where File.exists is no longer supported | |
| # | |
| # Extend the Ruby File class to restore the deprecated exists method | |
| # calls File.exist instead | |
| unless File.respond_to?(:exists?) | |
| class << File | |
| def exists?(path) | |
| warn "File.exists? is deprecated; use File.exist? instead." unless ENV['SUPPRESS_FILE_EXISTS_WARNING'] | |
| exist?(path) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks. it works well.