Mac 11.6.7 安装pod 关联XCode 13 新建项目
Mac安装pod
1、查看源
gem sources
2、移除现有镜像
gem sources --remove https://rubygems.org/
3、添加国内镜像
gem sources -a https://gems.ruby-china.com/
4、查看源
gem sources
apple@appledeMacBook-Pro TestPod % gem sources
*** CURRENT SOURCES ***
https://gems.ruby-china.com/
5 、安装pod
sudo gem install cocoapods
gems installed就说明安装成功了
6、关联项目
在项目根目录下创建Podfile文件(文本编辑即可)
platform :ios, '12.0'
target 'TestPod' do
end
7、初始化pod
cd 到项目根目录 pod install
Pod installation complete! 即成功了
通过.xcworkspace打开项目即可
备注:
1、sudo gem install cocoapods 如果出现
Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5 for inspection.错误
一般是universal-darwinXX对应不上,重新复制一份修改名字即可
我是将universal-darwin21复制一份修改为universal-darwin20即可
参考:https://blog.csdn.net/constant_rain/article/details/119914281
2、关联项目
关联项目时如果第一次就直接关联三方库失败,
可参考6解决,第一次不要关联三方库,pod install成功之后再添加三方库
3、Read From Disk 错误
https://blog.csdn.net/smileKH/article/details/121625142