zoukankan      html  css  js  c++  java
  • vagrant,在启动虚拟机的时候报错io.rb:32:in `encode': incomplete "xC8" on GBK (Encoding::InvalidByteSequenceError)

    描述

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

    解决过程

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

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

    参考内容:

    My Solution
    
    With the help of a non vagrant-related StackOverflow solution, I solved the issue by changing the line 32 in "Vagrantembeddedgemsgemsvagrant-2.0.1libvagrantutil" 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 up

  • 相关阅读:
    css基础1
    js基础
    定位与浮动
    最新学习
    前端初学第一天
    js2
    js1
    html加css
    js三元表达式
    java script的学习
  • 原文地址:https://www.cnblogs.com/SmallStrange/p/14154367.html
Copyright © 2011-2022 走看看