安装 CocoaPods

2018-10-10  本文已影响0人  wilken

1.gem sources -l 查看当前 gem 的源

2.删除原来的 gem 源 添加中国环境的源

gem sources --remove https://rubygems.org/

gem sources -a http://gems.ruby-china.com/

3.安装 cocoapos

sudo gem install cocoapods

如果出现错误:ERROR: While executing gem ... (Errno::EPERM)

    Operation not permitted - /usr/bin/xcodeproj

sudo gem install -n /usr/local/bin cocoapods

4.cd 到项目根目录

执行 pod init 生成podfile 文件

5.编辑 podfile 文件添加第三方库

->搜索第三方库 执行 pod search '第三方库名称'

->把第三方库添加到 podfile

 pod '第三方库名称'

6:安装第三方库

pod intall

7:打开项目

项目名字.xcworkspace

本文章来源:https://blog.csdn.net/qq_18505715/article/details/78833328

上一篇 下一篇

猜你喜欢

热点阅读