1:更新rudy
sudo gem update --system
2:更改镜像
1、gem sources --removehttps://rubygems.org/
2、gem sources -a https://ruby.taobao.org/
查看镜像成功:gem sources -l
3:安装cocoapods
以下的命令多打几次
sudo gem install cocoapods
出现的错误:active developer path
解决方式:sudo xcode-select —-switch /Applications/Xcode5.app/Contents/Developer
如:
sudo xcode-select --switch /Applications/Xcode7.app/Contents/Developerco
4:查询某个库
pod search AFNetworking
搜索结束后,不会自动退出显示搜索结果的状态。显示 “End”
此时按“Q”,退出结果显示,回到命令输入状态!
5:建项目
6:在项目所在的目录下,创建Podfile文件
vim Podfile
platform:iOS ,’7’
pod “AFNetworking”,”-> 2.0”
:wq退出
7:安装
pod install
8:打开项目名.xcworkspace文件
(新建文稿取名Podfile后缀名去掉放项目里也行。)