D:\vbcentos7>chcp Active code page: 65001 D:\vbcentos7>vagrant init centos/7 Traceback (most recent call last): 8: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/bin/vagrant:194:in `<main>' 7: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/bin/vagrant:194:in `new' 6: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/environment.rb:124:in `initialize' 5: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/platform.rb:271:in `fs_real_path' 4: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/platform.rb:271:in `each' 3: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/platform.rb:272:in `block in fs_real_path' 2: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/platform.rb:272:in `each' 1: from D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/platform.rb:274:in `block (2 levels) in fs_real_path' D:/program/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/platform.rb:274:in `encode': "\\xE5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK (Encoding::UndefinedConversionError) 该怎么解决
时间: 2023-08-01 09:13:00 浏览: 203
在命令提示符下使用的win7命令大全
5星 · 资源好评率100%
这个错误是由于 Vagrant 在执行 init 命令时无法将路径转换为 UTF-8 编码。解决方法是设置系统环境变量 VAGRANT_DETECTED_OS 为 "cygwin",具体步骤如下:
1. 右键点击“此电脑”,选择“属性”。
2. 点击“高级系统设置”。
3. 点击“环境变量”。
4. 在“系统变量”中找到“VAGRANT_DETECTED_OS”,如果没有则点击“新建”,输入“VAGRANT_DETECTED_OS”为变量名,"cygwin"为变量值,然后点击“确定”即可。
5. 重新打开命令行窗口,执行 vagrant init 命令即可。
希望对你有所帮助!
阅读全文