vagrant-hostsupdater icon indicating copy to clipboard operation
vagrant-hostsupdater copied to clipboard

Windows 10 - Vagrant 2.2.14 - HostsUpdater.rb:152:in `+': no implicit conversion of nil into String

Open rogerpfaff opened this issue 4 years ago • 2 comments

As in #190 when using Vagrant 2.2.14 throws an error about the conversion of nil to String. It works with vagrant 2.2.10, no info about the inbetween versions at this time.

rogerpfaff avatar Dec 11 '20 08:12 rogerpfaff

Same as in Windows 10

It happens at vagrant==2.2.14, at version vagrant 2.2.13 plugin does not work as expected (hostname entry is not populated in C:\Windows\System32\drivers\etc\hosts), at 2.2.10 works great indeed.

$ vagrant up
Installing the 'vagrant-hostsupdater --version '>= 1.2.0'' plugin. This can take a few minutes...
Installed the plugin 'vagrant-hostsupdater (1.2.0)'!
Bringing machine 'TestVM' up with 'virtualbox' provider...
==> TestVM: [vagrant-hostsupdater] Checking for host entries
==> TestVM: [vagrant-hostsupdater] Writing the following entries to (C:/WINDOWS/system32/drivers/etc/hosts)
==> TestVM: [vagrant-hostsupdater]   172.16.0.2  TestVM  # VAGRANT: d41d8cd98f00b204e9800998ecf8427e (TestVM) /
C:/Users/georgoma/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/HostsUpdater.rb:152:in `+': no implicit conversion of nil into String (TypeError)
        from C:/Users/georgoma/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/HostsUpdater.rb:152:in `addToHosts'
        from C:/Users/georgoma/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/HostsUpdater.rb:99:in `addHostEntries'
        from C:/Users/georgoma/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/Action/UpdateHosts.rb:17:in `call'

Update:

Using the v1.2.1 beta version fixes this issue

Tested on:

Windows 10 vagrant version 2.2.14 Virtualbox 6.1 vagrant-hostsupdater 1.2.1 - beta version

theodore86 avatar Dec 12 '20 16:12 theodore86

I can confirm the beta version working.

rogerpfaff avatar Dec 14 '20 10:12 rogerpfaff