I'm new to Ruby/Rails and I've been trying to install Rails under OSX Mavericks but I keep getting the following error:
我是Ruby / Rails的新手,我一直在尝试在OSX Mavericks下安装Rails但是我一直收到以下错误:
user_name$ gem install rails
/Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 29 (Psych::SyntaxError)
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/psych.rb:129:in `load'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:333:in `load_file'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:198:in `initialize'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `new'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:39:in `run'
from /Users/user_name/.rvm/rubies/ruby-2.0.0-p451/bin/gem:21:in `<main>'
I've tried to remove RVM and reinstall but I can't seem to find the cause of this error. All research seems to indicate the issue is related to YAML but I haven't even started a project yet so if it's parsing YAML it has to be an internal routine. I get the same message when I try to switch ruby versions as well.
我试图删除RVM并重新安装,但我似乎无法找到此错误的原因。所有研究似乎都表明这个问题与YAML有关,但我还没有开始一个项目,所以如果解析YAML它必须是一个内部例程。当我尝试切换ruby版本时,我收到相同的消息。
rvm use ruby-2.1.1
I've reinstalled Xcode, RVM, Ruby, and Homebrew but I keep getting the same error. I've ran ruby -c against all of the .rb files mentioned in the error and they all returned Syntax OK. What am I missing?
我重新安装了Xcode,RVM,Ruby和Homebrew,但我一直都遇到同样的错误。我已经对错误中提到的所有.rb文件运行了ruby -c,它们都返回了语法OK。我错过了什么?
1 个解决方案
#1
0
It seems that your gem configuration file (.gemrc) is not valid yaml and cause the parse error.
您的gem配置文件(.gemrc)似乎无效yaml并导致解析错误。
Try to fix the error in .gemrc file or just remove it and try again.
尝试修复.gemrc文件中的错误,或者只是将其删除然后重试。
#1
0
It seems that your gem configuration file (.gemrc) is not valid yaml and cause the parse error.
您的gem配置文件(.gemrc)似乎无效yaml并导致解析错误。
Try to fix the error in .gemrc file or just remove it and try again.
尝试修复.gemrc文件中的错误,或者只是将其删除然后重试。