2014-02-09 151 views
1

當我嘗試在小牛(10.9.1)上安裝Cocoapods或更新寶石時,我不斷收到以下內容,但無法找到解決方法。這裏的錯誤:Cocoapods安裝

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in parse': (<unknown>): could not find expected ':' while scanning a simple key at line 2 column 1 (Psych::SyntaxError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in parse_stream' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:153:in parse' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:129:in load' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:318:in load_file' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:191:in initialize' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in new' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in do_configuration' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in run' from /usr/bin/gem:21:in '

回答

2

它看起來像您的系統紅寶石版本和您試圖安裝的cocoapods版本之間的不兼容。

我強烈建議您安裝rvm來處理您的Mac上的ruby版本。

一旦安裝RVM嘗試運行運行:

$ gem install cocoapods 

RVM可以處理是每個用戶的系統上的多個Ruby版本。如果你每次運行ruby命令都使用sudo rvm也是你的答案。