终端按步骤输入
1、删除自带的ruby镜像 : gem sources --remove https://rubygems.org/
2、(原来的淘宝镜像https://ruby.taobao.org/已经不能用了): gem sources -a https://gems.ruby-china.org/
3、检查:gem sources -l
4、安装cocoapods: sudo gem install cocoapods
5、第四步如果报error 信息 换这句: sudo gem install -n /usr/local/bin cocoapods --pre
6、配置一下:pod setup
以AFNetworking为例
cd 到你的项目目录 然后
vim podfile
然后按一下 i 键(开始编辑的意思)
输入下面这坨代码 需要添加的框架自己搜索添加
platform:ios,'8.0'
target ‘text’ do
pod 'AFNetworking', '~>3.1.0'
end
写完后按下esc键 然后 :wq 退出编辑
然后 pod install
至此完成
网友评论