CocoaPods: Pod update/install 出错

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――### Report* What did you do?* What did you expect to happen?* What happened instead?### Stack```  CocoaPods : 0.29.0        Ruby : ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]    RubyGems : 2.2.2        Host : Mac OS X 10.9.2 (13C64)      Xcode : 5.0.2 (5A3005)Ruby lib dir : /Users/yilongxie/.rvm/rubies/ruby-2.1.1/libRepositories : master - https://github.com/CocoaPods/Specs.git @ 5dd666a63fa7fba4421d7f8375a76e8a8742df1e```### Podfile```rubyplatform :ios, '6.0'pod 'AFNetworking'```### Error```Psych::SyntaxError - (/Users/yilongxie/.cocoapods/repos/master/CocoaPods-version.yml): mapping values are not allowed in this context at line 3 column 4/Users/yilongxie/.rvm/gems/ruby-2.1.1/gems/psych-2.0.4/lib/psych.rb:370:in `parse'/Users/yilongxie/.rvm/gems/ruby-2.1.1/gems/psych-2.0.4/lib/psych.rb:370:in `parse_stream'/Users/yilongxie/.rvm/gems/ruby-2.1.1/gems/psych-2.0.4/lib/psych.rb:318:in `parse'/Users/yilongxie/.rvm/gems/ruby-2.1.1/gems/psych-2.0.4/lib/psych.rb:245:in `load'/Users/yilongxie/.rvm/gems/ruby-2.1.1/gems/psych-2.0.4/lib/psych.rb:464:in `block in load_file'/Users/yilongxie/.rvm/gems/ruby-2.1.1/gems/psych-2.0.4/lib/psych.rb:464:in `open'/Users/yilongxie/.rvm/gems/ruby-2.1.1/gems/psych-2.0.4/lib/psych.rb:464:in `load_file'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:261:in `version_information'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:222:in `repo_compatible?'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:281:in `master_repo_functional?'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:39:in `parse'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/claide-0.4.0/lib/claide/command.rb:186:in `parse'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:38:in `parse'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/claide-0.4.0/lib/claide/command.rb:211:in `run'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'/Users/yilongxie/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.29.0/bin/pod:24:in `'/Users/yilongxie/.rvm/rubies/ruby-2.1.1/bin/pod:23:in `load'/Users/yilongxie/.rvm/rubies/ruby-2.1.1/bin/pod:23:in `'/Users/yilongxie/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'/Users/yilongxie/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15: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%2Fyilongxie%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!

前段时间还可pod update 呢,昨天有个包更新结果一试不行了,于是在网上搜了一下:

大致步骤如下:

更新 CocoaPods  升级ruby

重装  $ sudo gem install cocoapods

结果还是不行,google 了一上发现有不少朋友也遇到过类似的问题,仔细想了一下这个问题应该很好解决可能是自己走错了路;于是又把问题理了一下,依照 https://github.com/CocoaPods/CocoaPods/issues/1853 提到的

>>>

Ok the problem for me was that (presumably) the update tried to merge CocoaPods-version.yml so in the end it looked like this.

---

<<<<<<< HEAD

min: 0.18.1

=======

min: 0.29.0

>>>>>>> 8365d0ad18508175bbde31b9dd2bdaf1be49214f

last: 0.29.0

I had the same problem with a private cocoaPod, I updated to 0.29 and I continued with the same problem.

Maybe it's very destructive but for me it was solved with:

$ sudo rm -fr ~/.cocoapods/repos/master

$ pod setup

pod setup 的时候又遇到了问题,就是半天没反应,我的网络已是经翻墙的肯定没问题取消好几次,一直显示:

$ pod setup

Setting up CocoaPods master repo

当时感觉可能还是没有解决,刚好还有一台MacBook Pro ,于是继续关注这台电脑,同时在另一台电脑上继续找方法;

等待永远都是漫长的,差不多过了一个多小时,

$ pod setup

Setting up CocoaPods master repo

Setup completed (read-only access)

终于看到了希望,赶紧到项目目录下进行测试

pod update

Analyzing dependencies      >>>>>看到这句我就知道终于弄好了

在另一台电脑上执行的命令:pod setup 在经历过漫长的等待后也终于有了正确的结果,所以大家如果在这一步卡住了一定要耐心;

解决该问题搜索过的感觉比较好的内容给大家分享一下:

http://code4app.com/article/cocoapods-install-usage  CocoaPods安装和使用教程

http://blog.csdn.net/wzzvictory/article/details/18737437  CocoaPods详解之----使用篇

http://blog.csdn.net/liufan321/article/details/17572121  iOS程序依赖管理的工具——CocoaPods

http://blog.csdn.net/cssmhyl/article/details/20555107 使用cocoapods时,pod setup出错解决

https://github.com/CocoaPods/CocoaPods/issues/1853  I just updated cocoapods to 0.29 (also tested with 0.28) from a super old version (can't remember which one) and now I run into the following error message when I execute 'pod instal'l.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,716评论 4 364
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,558评论 1 294
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,431评论 0 244
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,127评论 0 209
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,511评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,692评论 1 222
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,915评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,664评论 0 202
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,412评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,616评论 2 245
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,105评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,424评论 2 254
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,098评论 3 238
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,096评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,869评论 0 197
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,748评论 2 276
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,641评论 2 271

推荐阅读更多精彩内容