[iOS][CocoaPods] Psych::SyntaxError - ( .cocoapods/repos/master/CocoaPods-version.yml): mapping values are not allowed in this context at line 3 column 4

Wed, May 14, 2014 - 2 min read

iOS アプリを久しぶりにビルドしようと思って pod install したところ、安定のエラーが発生しました。

pod install

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 0.29.0
        Ruby : ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.1]
    RubyGems : 1.8.25
        Host : Mac OS X 10.9.2 (13C1021)
       Xcode : 5.1.1 (5B1008)
Ruby lib dir : /Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ b8a8633c844c3666a95b28edf1d821acfd1b1baf
```

### Podfile

```ruby
platform :ios, '6.0'
pod 'NSLogger'
pod 'Parse'
...
```

### Error

```
Psych::SyntaxError - (/Users/your_username/.cocoapods/repos/master/CocoaPods-version.yml): mapping values are not allowed in this context at line 3 column 4
/Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in `parse'
/Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
/Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:151:in `parse'
/Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:127:in `load'
/Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:297:in `block in load_file'
/Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:297:in `open'
/Users/your_username/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:297:in `load_file'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:261:in `version_information'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:222:in `repo_compatible?'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:281:in `master_repo_functional?'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:39:in `parse'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/claide-0.4.0/lib/claide/command.rb:179:in `parse'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:38:in `parse'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/claide-0.4.0/lib/claide/command.rb:211:in `run'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/gems/cocoapods-0.29.0/bin/pod:24:in `'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/bin/pod:19:in `load'
/Users/your_username/.rvm/gems/ruby-1.9.3-p448/bin/pod:19:in `
' /Users/your_username/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval' /Users/your_username/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `
' ``` ――― TEMPLATE END ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― [!] Oh no, an error occurred. Search for existing github issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=%28%2FUsers%2Fyour_username%2F.cocoapods%2Frepos%2Fmaster%2FCocoaPods-version.yml%29%3A+mapping+values+are+not+allowed+in+this+context+at+line+3+column+4&type=Issues If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new Don't forget to anonymize any private data!

cocoapods を最新版にアップデートして、setup し直せば良いと Stack Overflow に書いてあったので、その通りやってみました。

ios - CocoaPods install issue - Stack Overflow

gem update cocoapods
pod --version
0.32.1
cd ~/.cocoapods/repos
rm -rf master
pod setup

再度、 pod install すれば OK