版本問題引起的報(bào)錯(cuò)解決如下:
首先1.0.0版的creatfile書寫格式必須是下面這種
platform :ios, '8.0'
use_frameworks!
新版的cocoapods
target '備課-百思不得姐' do
pod 'ORStackView'
pod 'SwiftyJSON'
pod 'SDWebImage'
pod 'AFNetworking'
pod 'SVProgressHUD'
pod 'MJExtension'
pod 'MJRefresh'
pod 'DACircularProgress'
pod 'pop'
pod 'NJKWebViewProgress'
end
其次,是因?yàn)槔习姹竞托掳娴膶?dǎo)入頭文件的方式不對引起的
老版本導(dǎo)入頭文件方式:#import <SVProgressHUD.h>
新版本導(dǎo)入頭文件方式:#import "SVProgressHUD.h"
Report* What did you do?* What did you expect to happen?* What happened instead?
Stack
Podfile
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!
前段時(shí)間還可pod update 呢川队,昨天有個(gè)包更新結(jié)果一試不行了类浪,于是在網(wǎng)上搜了一下:
大致步驟如下:
更新 CocoaPods 升級ruby
重裝 $ sudo gem install cocoapods
結(jié)果還是不行,google 了一上發(fā)現(xiàn)有不少朋友也遇到過類似的問題,仔細(xì)想了一下這個(gè)問題應(yīng)該很好解決可能是自己走錯(cuò)了路;于是又把問題理了一下,依照 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 的時(shí)候又遇到了問題,就是半天沒反應(yīng),我的網(wǎng)絡(luò)已是經(jīng)翻墻的肯定沒問題取消好幾次钱床,一直顯示:
$ pod setup
Setting up CocoaPods master repo
當(dāng)時(shí)感覺可能還是沒有解決,剛好還有一臺MacBook Pro 埠居,于是繼續(xù)關(guān)注這臺電腦查牌,同時(shí)在另一臺電腦上繼續(xù)找方法;
等待永遠(yuǎn)都是漫長的滥壕,差不多過了一個(gè)多小時(shí)僧免,
$ pod setup
Setting up CocoaPods master repo
Setup completed (read-only access)
終于看到了希望,趕緊到項(xiàng)目目錄下進(jìn)行測試
pod update
Analyzing dependencies >>>>>看到這句我就知道終于弄好了
在另一臺電腦上執(zhí)行的命令:pod setup 在經(jīng)歷過漫長的等待后也終于有了正確的結(jié)果,所以大家如果在這一步卡住了一定要耐心捏浊;
解決該問題搜索過的感覺比較好的內(nèi)容給大家分享一下:
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時(shí)懂衩,pod setup出錯(cuò)解決
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.