一、错误
(1)错误:Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1
解决办法:sudo gem install cocoapods-core
(2)错误: CocoaPods could not find compatible versions for pod "BRPickerView":
In Podfile:
解决:pod install --repo-update
(3)错误:Installing xxx
[!] Error installing xxx
[!] /usr/local/bin/git clone https://github.com/91renb/xxx.git /var/folders/yd/xxx/T/d20210318-9800-gykob8 --template= --single-branch --depth 1 --branch 2.7.3
Cloning into '/var/folders/yd/c87pmc5n5svd_dcqt1890qrm0000gn/T/d20210318-9800-gykob8'...
fatal: unable to access 'https://github.com/91renb/BRPickerView.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
解决:出现这种情况多半是因为设置了系统代理
取消全局代理即可
git config --global --unset http.proxy
git config --global --unset https.proxy
如果取消全局代理无效,只能翻墙
(4)警告:
Smart quotes were detected and ignored in your Podfile. 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.
解释:podfile文件中 使用了中文的单引号’‘ 而非英文下的单引号''
二、内容
(1)podfile文件exec格式转换
终端先cd到根目录
正常格式:终端使用命令chmod 644 Podfile(即文件名) 就会变回正常的了
exec格式:终端使用命令chmod 700 Podfile(即文件名) 就会变回exec格式
(2)清华大学镜像
清华大学镜像可解决Cocoapods install 慢的问题
清华大学镜像网址:https://mirrors.tuna.tsinghua.edu.cn/
pod repo remove master
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
pod repo update
或者
cd ~/.cocoapods/repos
pod repo remove master
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
然后在项目的 Podfile在最开头加上:source ‘https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git’