1.移除现有Ruby默认源
$gem sources --remove https://rubygems.org/
2.使用新的源
$gem sources -a https://ruby.taobao.org/
3.验证新源是否替换成功
$gem sources -l

4.安装CocoaPods
(1)$sudo gem install cocoapods 备注:苹果系统升级OS X EL Capitan后改为$sudo gem install -n /usr/local/bin cocoapods
(2)$pod setup
5.更新gem
$sudo gem update --system
6.新建工程,并在终端用cd指令到文件夹内

7.查看进入项目没有,能打印出项目就是成功了
ls

8.创建podfile文件
touch podfile

9.打开podfile文件输入你要安装的库,注意,不可以错一个字母

10.然后回到终端输入pod install 会比较慢,安装的时候不要以为挂了,等几分钟
注意打开项目请用这个打开

这里可以看已经安装的SDK

网友评论