第一步:更新ruby
终端命令:sudo gem install cocoapods
第二步:安装完毕,运行命令
终端命令:pod setup
第三步:cd 到工程目录下
第四步:创建Podfile文件
终端命令:touch Podfile
第五步:打开Podfile文件
终端命令: open -e Podfile
第六步: 将所需第三方库写入Podfile文件
例如:platform :ios pod 'AFNetworking' , '0.9.1' 然后保存
第七步:重新配置
终端命令:pod install
如果不出意外,应该成功了。每次有更新时,只需 终端运行命令:pod update.就行了。