環境
- vagrant-hostsupdater 0.0.11
コード変更
変更するファイル
"C:\Users\<username>\.vagrant.d\gems\gems\vagrant-hostsupdater-0.0.11\lib\vagrant-hostsupdater\HostsUpdater.rb"
HostsUpdater.rb
key, options = network[0], network[1]
ip = options[:ip] if key == :private_network
ips.push(ip) if ip
これを
HostsUpdater.rb
key, options = network[0], network[1]
ip = options[:ip] if key == :private_network || key == :public_network
ips.push(ip) if ip
こう。
簡単ですね。
尚、Win8.1などでは通常のコマンドプロンプトからではhostsファイルの変更ができないので、Vagrantの起動に使うコマンドプロンプトは管理者として実行したコマンドプロンプトを使おう。