vagrant,在启动虚拟机的时候报错io.rb:32:in `encode': incomplete "\xC8" on GBK (Encoding::Invalid

描述

  这几天在windows环境上,部署了vagrant,在启动虚拟机的时候报错:

vagrant,在启动虚拟机的时候报错io.rb:32:in `encode': incomplete "\xC8" on GBK (Encoding::Invalid

解决过程

  找了好久,都没有说明白,后来在国外的github上看到了解决的方案。

参考地址:https://github.com/hashicorp/vagrant/issues/9368

参考内容:

My Solution

With the help of a non vagrant-related * solution, I solved the issue by changing the line 32 in "Vagrant\embedded\gems\gems\vagrant-2.0.1\lib\vagrant\util" as:

data << io.readpartial(READ_CHUNK_SIZE).encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')

即修改源代码,说改就改:

  #data << io.readpartial(READ_CHUNK_SIZE).encode("UTF-8", Encoding.default_external)
  data << io.readpartial(READ_CHUNK_SIZE).encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')

vagrant,在启动虚拟机的时候报错io.rb:32:in `encode': incomplete "\xC8" on GBK (Encoding::Invalid

 

 

  修改之后,重新执行命令vagrant up

vagrant,在启动虚拟机的时候报错io.rb:32:in `encode': incomplete "\xC8" on GBK (Encoding::Invalid

 

上一篇:linux虚拟机安装


下一篇:使用 vagrant 创建多节点虚拟机集群