Help us understand the problem. What is going on with this article?

VagrantコマンドでEncoding::InvalidByteSequenceError

More than 3 years have passed since last update.

※2016年11月に、別のブログで書いた記事を移行したものです。


vagrant up, vagrant halt, vagrant sshなどで、たびたび C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/util/io.rb:32:in `encode': incomplete "\x98" on Windows-31J (Encoding::InvalidByteSequenceError) が起きました。

C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/util/ にある、io.rb の32行目を

data << io.readpartial(READ_CHUNK_SIZE).encode("UTF-8", Encoding.default_external)

以下のように変更

data << io.readpartial(READ_CHUNK_SIZE).encode("Windows-31J", Encoding.default_external)

これで直ります。

mokuo
Webエンジニアをやっています。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away