Reputation: 59
When doing vagrant up
I get this error:
==> default: Exporting NFS shared folders...
Traceback (most recent call last):
106: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
105: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/machine.rb:201:in `action'
.....
/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb:20:in `resolve_host_path': uninitialized constant VagrantPlugins::HostDarwin::Cap::Version (NameError)
I updated Vagrant and VirtualBox. How can I fix this?
Upvotes: 5
Views: 4324
Reputation: 1591
Fixed vagrant 2.2.19 with this patch contributed to https://github.com/hashicorp/vagrant/issues/12583:
+ $ diff -u /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb.backup-20220104 path.rb
--- /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb.backup-20220104 2022-01-04 12:35:09.000000000 +0100
+++ path.rb 2022-01-04 12:35:21.000000000 +0100
@@ -17,7 +17,8 @@
def self.resolve_host_path(env, path)
path = File.expand_path(path)
# Only expand firmlink paths on Catalina
- return path if !CATALINA_CONSTRAINT.satisfied_by?(Cap::Version.version(env))
+ host_version = env.host.capability(:version)
+ return path if !CATALINA_CONSTRAINT.satisfied_by?(host_version)
firmlink = firmlink_map.detect do |mount_path, data_path|
path.start_with?(mount_path)
Upvotes: 0
Reputation: 2598
The solution is to run this command:
sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb
This command was found here.
Upvotes: 11
Reputation: 11
I also had the same error:
uninitialized constant VagrantPlugins::HostDarwin::Cap::Version (NameError)
Downgrading Vagrant from 2.2.19
to 2.2.18
fixed it for me.
Upvotes: 1