Parallels / vagrant-parallels

Vagrant Parallels Provider

Home Page:https://parallels.github.io/vagrant-parallels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined method `synced_folder_capability' for VagrantPlugins::Parallels::Plugin:Class

emacaste opened this issue · comments

Installed the plugin 'vagrant-parallels (2.2.4)'!
Parzival:Homestead ilman$ vagrant up
Vagrant failed to initialize at a very early stage:

The plugins failed to load properly. The error message given is
shown below.

undefined method `synced_folder_capability' for VagrantPlugins::Parallels::Plugin:Class

Macos Monterey and Vagrant 2.2.9

Thx

Hi @beniaminorossini ,
Could you please try to reproduce this issue with latest Vagrant version (2.2.19 at this moment)?
If it still happens - please post the Vagrantfile which could be used to reproduce it.

Thank you!

commented

Hi @legal90. Running on latest vagrant and Monterey. I'm facing the same issue. Here is my vagrant file. Any idea what's wrong ? It looks like the plugin doesn't appear there, which is weird as it shows a successful install.
At that point I'm getting a bit lost on why I get this error. Any hint would be much appreciated 👍


EDIT: the issue at that stage was coming from vagrant. I simply uninstalled it and reinstalled using brew install vagrant, then installed the plugin and vagrant up worked like a charm after that.


# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path(File.dirname(__FILE__))

homesteadYamlPath = confDir + "/Homestead.yaml"
homesteadJsonPath = confDir + "/Homestead.json"
afterScriptPath = confDir + "/after.sh"
customizationScriptPath = confDir + "/user-customizations.sh"
aliasesPath = confDir + "/aliases"

require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')

Vagrant.require_version '>= 2.2.4'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exist? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
        config.vm.provision "handle_aliases", type: "shell" do |s|
            s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases && chown vagrant:vagrant /home/vagrant/.bash_aliases"
        end
    end

    if File.exist? homesteadYamlPath then
        settings = YAML::load(File.read(homesteadYamlPath))
    elsif File.exist? homesteadJsonPath then
        settings = JSON::parse(File.read(homesteadJsonPath))
    else
        abort "Homestead settings file not found in #{confDir}"
    end

    Homestead.configure(config, settings)

    if File.exist? afterScriptPath then
        config.vm.provision "Run after.sh", type: "shell", path: afterScriptPath, privileged: false, keep_color: true
    end

    if File.exist? customizationScriptPath then
        config.vm.provision "Run customize script", type: "shell", path: customizationScriptPath, privileged: false, keep_color: true
    end

    if Vagrant.has_plugin?('vagrant-hostsupdater')
        config.hostsupdater.remove_on_suspend = false
        config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
    elsif Vagrant.has_plugin?('vagrant-hostmanager')
        config.hostmanager.enabled = true
        config.hostmanager.manage_host = true
        config.hostmanager.aliases = settings['sites'].map { |site| site['map'] }
    elsif Vagrant.has_plugin?('vagrant-goodhosts')
        config.goodhosts.aliases = settings['sites'].map { |site| site['map'] }
    end

    if Vagrant.has_plugin?('vagrant-notify-forwarder')
        config.notify_forwarder.enable = true
    end
end

Thank you for the information, @DanDvoracek,
The fact that the re-installation of Vagrant fixes this issue, means that the root cause is located somewhere outside our plugin.

My thoughts:

undefined method `synced_folder_capability' for VagrantPlugins::Parallels::Plugin:Class

This error means that Vagrant can't find the definition of synced_folder_capability, while it has to be in the core Vagrant bundle: https://github.com/hashicorp/vagrant/blob/3d68e16f1b5d616f879d24f48dac2598acac0a38/lib/vagrant/plugin/v2/plugin.rb#L257-L260
Probably, this file got corrupted or missing on the filesystem. I recommend checking it if you encounter this issue next time.
If Vagrant is installed by the official installer (.dmg), this file should be located here:

/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/plugin/v2/plugin.rb