Home>
Problem

vagrant up
vagrant ssh
vagrant destroy
vagrant global-status
The same error is displayed when executing the vagrant command.

Error message
nekonoMacBook-Air: homestead neko $vagrant up
An unexpected error occurred while loading the vagrant-login
plugin. Please contact support with the following
error code: '7'.
app/homestead/resources/localized/vagrantfile
#-*-mode: ruby-*-
# vi: set ft = ruby:
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION || = "2"
confDir = $confDir || = File.expand_path ("vendor/laravel/homestead", File.dirname (__ FILE__))
homesteadYamlPath = File.expand_path ("Homestead.yaml", File.dirname (__ FILE__))
homesteadJsonPath = File.expand_path ("Homestead.json", File.dirname (__ FILE__))
afterScriptPath = "after.sh"
customizationScriptPath = "user-customizations.sh"
aliasesPath = "aliases"
require File.expand_path (confDir + '/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 "shell" do | s |
            s.inline = "awk '{sub (\" \ r $\ ", \" \ ");print}'/tmp/bash_aliases>/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" + File.dirname (__ FILE__)
    end
    Homestead.configure (config, settings)
    if File.exist? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true
    end
    if File.exist? customizationScriptPath then
        config.vm.provision "shell", path: customizationScriptPath, privileged: false, keep_color: true
    end
    if Vagrant.has_plugin? ('vagrant-hostsupdater')
        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']}
    end
end
app/homestead/vagrantfile
#-*-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 "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 "shell", path: afterScriptPath, privileged: false, keep_color: true
    end
    if File.exist? customizationScriptPath then
        config.vm.provision "shell", path: customizationScriptPath, privileged: false, keep_color: true
    end
    if Vagrant.has_plugin? ('vagrant-hostsupdater')
        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']}
    end
    if Vagrant.has_plugin? ('vagrant-notify-forwarder')
        config.notify_forwarder.enable = true
    end
end
Homestead.json
{
    "ip": "192.168.10.10",
    "memory": 2048,
    "cpus": 2,
    "provider": "virtualbox",
    "authorize": "~/.ssh/id_rsa.pub",
    "keys": [
        "~/.ssh/id_rsa"
    ],


    "folders": [
        {
            "map": "~/code",
            "to": "/ home/vagrant/code"
        }
    ],


    "sites": [
        {"map": "homestead.test",
            "to": "/ home/vagrant/code/public"
        }
    ],


    "databases": [
        "homestead"
    ],


    "features": [
        {
            "mariadb": false
        },

 
        {
            "ohmyzsh": false
        },

 
        {
            "webdriver": false
        }
    ]
}

vagrant plugin install vagrant-share --plugin-version 1.1.8
This error is now displayed after execution.

vagrant plugin uninstall After executing vagrant-share, the vagrant command changed the following error.

nekonoMacBook-Air: homestead neko $vagrant up
An unexpected error occurred while loading the vagrant-login
plugin. Please contact support with the following
error code: '7'.
nekonoMacBook-Air: homestead neko $vagrant plugin uninstall vagrant-share
Uninstalling the 'vagrant-share' plugin ...
Successfully uninstalled vagrant-share-1.1.8
nekonoMacBook-Air: homestead neko $vagrant up
/opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:377:in `parse ': (<unknown>): could not find expected': 'while scanning a simple key at line 3 column 1 ( Psych :: SyntaxError)
    from /opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:377:in `parse_stream '
    from /opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:325:in `parse '
    from /opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:252:in `load '
    from/Users/neko/app/Homestead/Vagrantfile: 29: in `block in<top (required)>'
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/v2/loader.rb:37:in `load '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:119:in `each '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:119:in `block in load '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:116:in `each '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:116:in `load '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/vagrantfile.rb:29:in `initialize '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:792:in `new '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:792:in `vagrantfile '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:973:in `process_configured_plugins'
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:178:in `initialize '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/bin/vagrant:145:in `new '
    from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/bin/vagrant:145:in `<main>'
Supplemental information (FW/tool version etc.)

mac os

vagrant -v
Vagrant 2.2.5

  • Answer # 1

      

    vagrant plugin install vagrant-share --plugin-version 1.1.8

    This may be caused by installing an older version of the plug-in at

    .

    A quick way is to reinstall Vagrant and install the latest plug-in.

  • Answer # 2

    You should try uninstalling the plugin first.

    vagrant plugin uninstall vagrant-share