首页 > 代码库 > 一个cocoapods问题的解决,希望能帮助到遇到类似情况的人
一个cocoapods问题的解决,希望能帮助到遇到类似情况的人
之前10.7的系统上运行过cocoapods没有问题。现在系统版本升级到了10.9,尝试使用cocoapods遇到问题,报告了类似下面的错误:Psych::SyntaxError - (/Users/psteinacher/.cocoapods/repos/master/CocoaPods-version.yml): mapping values are not allowed in this context at line 3 column 4 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse‘ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse_stream‘ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:153:in `parse‘ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:129:in `load‘ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `block in load_file‘ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `open‘ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `load_file‘ /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/sources_manager.rb:248:in `version_information‘ /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/sources_manager.rb:209:in `repo_compatible?‘ /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/sources_manager.rb:268:in `master_repo_functional?‘ /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/command.rb:40:in `parse‘ /Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:179:in `parse‘ /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/command.rb:39:in `parse‘ /Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:211:in `run‘ /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/command.rb:52:in `run‘ /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/bin/pod:24:in `<top (required)>‘经过多方尝试,发现执行如下的命令可以解决问题:
$ sudo rm -fr ~/.cocoapods/repos/master $ pod setup最后推荐一个xcode插件,可以很方便的使用cocoapods。CocoaPods for Xcode非常方便的Xcode pods插件。可以很方便的在Xcode通过pods安装各种objective-c第三方库,省去以前还要手动去跑pods命令行的麻烦;此外,还支持通过cocoaDocs来安装库文档。唯一的遗憾是,它目前只支持Xcode5,4版本还用不了。项目地址:https://github.com/kattrali/cocoapods-xcode-pluginEnjoy it!
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。