使用Xcode的CocoaPods插件報(bào)錯(cuò)的問題
1.打開插件CocoaPods
方法:
頂部菜單欄 -點(diǎn)擊Product,彈出列表如下:
2.創(chuàng)建PodFile,如下圖
3.選中Create/Edit Podfile并點(diǎn)擊,會(huì)彈出如下圖
4.編輯Podfile,你所需要的三方框架,編輯完成后,com+S保存,然后關(guān)閉此編輯頁(yè)面。
5.安裝三方框架
選中如上圖所示;點(diǎn)擊Upadate Pods(office only)不會(huì)更新倉(cāng)庫(kù);如果需要更新,點(diǎn)擊Upadate Pods
。
如果出現(xiàn)如下錯(cuò)誤信息。是因?yàn)槟愕腉EM_PATH的路徑錯(cuò)誤
解決的方案:如下
在終端輸入一下命令:
$ which pod
會(huì)輸出一下結(jié)果:
/Users/XXX/.rvm/rubies/ruby-2.0.0-p643/bin/pod
那么,你的GEM_PATH的路徑:/Users/XXX/.rvm/rubies/ruby-2.0.0-p643/bin
6.將新路徑添加到如下圖所示:然后重新做第5步的操作
7.以上操作都正確,你工程會(huì)打印如下的結(jié)果:
GEM_PATH的路徑/pod update --no-repo-update
Update all pods
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.0.4)
Installing SDWebImage (3.7.5)
Installing SVProgressHUD (1.1.3)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `XXX.xcworkspace` for this project from now on.
Pod installation complete! There are 3 dependencies from the Podfile and 3 total pods installed.