1卸亮、安裝或更新Cocoapods時提示沒權(quán)限
$ gem install cocoapods
Fetching: cocoapods-core-0.38.2.gem (100%)
ERROR: while executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
解決辦法:在命令行前加入 sudo
$ sudo gem install cocoapods
password:
Fetching: cocoapods-core-0.38.2.gem (100%)
2橱夭、安裝或更新第三方庫時提示找不到庫
$ pod install
Analyzing dependencies
[!] Unable to find a specification for 'AfNetworking (~> 2.0)'
原因:要么是安裝完Cocoapods后沒執(zhí)行pod setup什燕,要么就是pod setup失敗
解決辦法:清除后闹丐,重新 setup烘嘱,執(zhí)行以下命令
$ pod repo remove master
$ pod setup
3鹦付、安裝或更新第三方庫時卡主或超慢
$ pod install
Updating local specs repositories
或
$ pod install
Analyzing dependencies
原因:被墻了
解決辦法:使用以下命令進行 install 或 update
$ pod install --verbose --no-repo-update
$ pod update --verbose --no-repo-update
4尚粘、安裝或更新第三方庫時出現(xiàn)如下警告
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
原因:
1、不要使用文本編輯去編輯Podfile文件敲长,使用Xcode編輯郎嫁,或者使用終端敲命令去編輯。
2祈噪、Podfile 的內(nèi)容語法格式有問題
5泽铛、安裝或更新第三方庫時出現(xiàn)如下錯誤
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target
ParentPortal
toPods/Target Support Files/Pods/Pods.debug.xcconfig
or include thePods/Target Support Files/Pods/Pods.debug.xcconfig
in your build configuration.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target ParentPortal
to Pods/Target Support Files/Pods/Pods.release.xcconfig
or include the Pods/Target Support Files/Pods/Pods.release.xcconfig
in your build configuration.
解決辦法:修改Configurations為None,如下圖所示
6辑鲤、OSX系統(tǒng)升級到10.11后盔腔,無法使用 Cocoapods 命令
$ -bash: pod: command not found
解決辦法:
$ sudo install -n /usr/local/bin cocoapods
之后 pod 命令就可以正常使用了