Vagrant在所有命令上失败并出现相同错误“找不到代码转换器”

时间:2013-11-07 18:14:59

标签: ruby vagrant

我在Windows 7笔记本电脑上安装了vagrant 1.3.4,然后尝试从命令行输入vagrant init。它因以下错误而失败。我尝试了其他命令(甚至是vagrant --help),但仍然收到同样的错误。我试着谷歌搜索一段时间无济于事。是否有人可以解释为什么会发生这种错误?任何输入都表示赞赏。感谢

C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:268:in `[]': code converter not found (
UTF-16LE to Windows-1258) (Encoding::ConverterNotFoundError)
    from    C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:268:in `block in _all'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:267:in `each'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:267:in `_all'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:410:in `each'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `find_all'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `matching_specs'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:238:in `to_specs'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
    from C:/HashiCorp/Vagrant/bin//../embedded/../embedded/gems/bin/vagrant:22:in `<main>'

2 个答案:

答案 0 :(得分:0)

在搜索了一段时间后,这似乎是Ruby的一个问题,我在这里找到了答案:

Error installing Rubygems on ruby command prompt in Win7

我做了同样的事情,将我的地区从越南改为美国并解决了问题。

答案 1 :(得分:0)

您可以在chcp 65001 > nul

之后的vagrant.bat顶部添加@ECHO OFF