vagrant up 编码问题

服务器运维 / 758人浏览 / 0人评论

vagrant up \xC4 编码 UTF-8 问题,HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:44:in encode!': "\xC4" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE (Encoding::UndefinedConversionError)

vagrant up UTF-16LE编码报错

laravel vagrant up 报错 process_builder.rb:44:in encode!': "xC4" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE (Encoding::UndefinedConversionError)

problem: C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:44:in encode!': "xC4" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE (Encoding::UndefinedConversionError) from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:44:in to_wide_string' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:67:in create_environment_pointer' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:28:in start' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process.rb:70:in launch_process' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/abstract_process.rb:81:in start' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:155:in block in execute' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:26:in block (2 levels) in safe_chdir' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:25:in chdir' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:25:in block in safe_chdir' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:24:in synchronize' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:24:in safe_chdir' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:154:in execute' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:22:in execute' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/powershell.rb:174:in version' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/powershell.rb:195:in validate_install!' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/powershell.rb:96:in execute_cmd' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/platform.rb:82:in block in windows_admin?' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/platform.rb:84:in windows_admin?' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/hyperv/provider.rb:20:in usable?' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:361:in block in default_provider' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/registry.rb:49:in block in each' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/registry.rb:48:in each' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/registry.rb:48:in each' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:347:in default_provider' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:943:in guess_provider' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:955:in find_configured_plugins' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:983:in process_configured_plugins' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:178:in initialize' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/bin/vagrant:168:in new' from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/bin/vagrant:168:in `'

解决办法:

You should go to "C:HashiCorpVagrantembeddedgems2.2.14gemsvagrant-2.2.14bin" address and open "vagrant" file. At the beginning of the file, you will see "#!/usr/bin/env ruby" Paste the below 2 lines after this first line.
在目录:C:HashiCorpVagrantembeddedgems2.2.14gemsvagrant-2.2.14bin 找到vagrant文件,找到"#!/usr/bin/env ruby",在下方添加一下内容,保存即可。

Encoding.default_external = Encoding.find('Windows-1251')
Encoding.default_internal = Encoding.find('Windows-1251')

Be careful, they are "1251", not "1250".(仔细一点是1251,不是1250)

https://stackoverflow.com/questions/65263027/laravel-vagrant-homestead-fails-to-install-git-bash-error

转载注明:

扩展查找

0 条评论

还没有人发表评论

发表评论 取消回复

记住我的信息,方便下次评论
有人回复时邮件通知我