Ошибка при бродячем вверх
Я получаю следующую ошибку при выполнении vagrant up:
$ vagrant up
D:/Jumbo/vagrants/endeca_vagrants/Vagrantfile:27:in `block in <top (required)>': undefined method `[]' for nil:NilClass (NoMethodError)
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/config/v2/loader.rb:37:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/config/v2/loader.rb:37:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/config/loader.rb:107:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/config/loader.rb:107:in `block in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/config/loader.rb:104:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/config/loader.rb:104:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/vagrantfile.rb:28:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/environment.rb:746:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/environment.rb:746:in `vagrantfile'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/environment.rb:492:in `host'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/environment.rb:214:in `block in action_runner'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/action/runner.rb:33:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/action/runner.rb:33:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/environment.rb:479:in `hook'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/environment.rb:728:in `unload'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/bin/vagrant:141:in `ensure in <main>'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.5/bin/vagrant:141:in `<main>'
Содержимое моего файла Vagrant выглядит следующим образом:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Copyright 2012, Javelin Group
require 'yaml'
current_dir = File.dirname(File.expand_path(__FILE__))
configs = YAML.load_file("#{current_dir}/config.yaml")
vagrant_config = configs['configs'][ENV['USER']]
Vagrant.configure("2") do |config|
config.vm.box = "D:/Jumbo/JumboDoc/endecavagrant/endeca.box"
# Boot with a GUI so you can see the screen. (Default is headless)
config.vm.provider "virtualbox" do |v|
v.gui = false
v.customize ["modifyvm", :id, "--memory", 4096]
v.name = "Jumbo Endeca VM"
end
config.vm.network :forwarded_port, guest: 8006, host: 8006, auto_correct: true
config.vm.network :forwarded_port, guest: 8888, host: 8888, auto_correct: true
config.vm.network(:private_network, ip: "192.168.50.3", virtualbox__intnet: "intnet")
# maps workstation kattle ETL folder to the vm folder
config.vm.synced_folder "#{vagrant_config['etl_dir']}", "/usr/local/endeca-deployment/development/etl"
config.vm.network(:private_network, ip: "192.168.50.3", virtualbox__intnet: "intnet")
# maps workstation endeca custom app config folder to the vm folder
config.vm.synced_folder "#{vagrant_config['app_config']}", "/usr/local/endeca-deployment/development/custom-script"
config.vm.synced_folder "#{vagrant_config['pipelines']}", "/usr/local/endeca-deployment/development/config/pipelines"
config.vm.synced_folder "#{vagrant_config['templates']}", "/usr/local/endeca-deployment/development/cartridge_templates"
config.vm.synced_folder "#{vagrant_config['report_templates']}", "/usr/local/endeca-deployment/development/report_templates"
end
Я попытался обновить версию виртуальной коробки oracle vm. Также vagrant 1.9.4 работает с тем же файлом в других системах. Я также пытался очистить место на диске C:. Но не получил решение. Как я могу это исправить? Пожалуйста помоги.
1 ответ
Ошибка состояла в том, что он не находил пользователя из окружения. Вот почему vagrant_configs был равен нулю. Спасибо @axiac.