执行任何gem
命令时出现以下错误。例如:
gem update --system.
C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 2 column 1 (Psych::SyntaxError)
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:151:in `parse'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:127:in `load'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:253:in `load_file'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:191:in `initialize'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `new'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `do_configuration'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:51:in `run'
from C:/Ruby193/bin/gem:30:in `<main>'
我使用Windows Ruby安装程序安装了Ruby。安装完成后,我执行了命令以检查它是否已安装:
$ ruby -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
到目前为止一切顺利。每当我运行命令gem
时,就会出现问题。任何人都可以帮我解决这个问题吗?
答案 0 :(得分:1)
YAML.load使用Psych来加载和解析yaml文件。该错误告诉您在load_file方法中的config_file.rb:253中加载的yaml文件中存在语法错误。配置文件可能已损坏。
除此之外,可能只是重新安装rvm或其他版本管理器。对于Windows上的rvm Here is a link。