美文网首页
cocoapods使用步骤[MJ]

cocoapods使用步骤[MJ]

作者: KevenT | 来源:发表于2018-08-07 23:42 被阅读0次

更换源

  • Gem是一个管理Ruby库和程序的标准包,它通过Ruby Gem(如http://rubygems.org/)源来查找、安装、升级和卸载软件包
gem sources --remove https://rubygems.org/
gem sources -a http://ruby.taobao.org/
gem sources -l

更新升级gem(以后出现问题,尝试这个)

sudo gem update --system

安装

sudo gem install cocoapods

更换repo镜像为国内服务器

pod repo remove master
pod repo add master https://gitcafe.com/akuandev/Specs.git
pod repo add master http://git.oschina.net/akuandev/Specs.git
pod repo update
  • (注意:但是执行pod repo remove master之后老是提示[!] repo master does not exist虽后执行 pod repo add master https://git.coding.net/CocoaPods/Specs.git之后又会提示[!] To setup the master specs repo, please run pod setup. 然后就无限卡死这两步,不知道是因为cocoapods版本的问题还是网络的问题,最后直接手动将代码git到本地得以解决问题:
$ git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master

初始化第三方库信息(以后出现问题,尝试这个)

pod setup

以后更新第三方库信息

pod repo update

搜索

pod search

新建Podfile

vim Podfile
  • 输入i:进入编辑状态
  • 输入dd删除当前行
  • 输入完信息依次esc->:->wq

捷信Podfile,安装第三方框架

pod install

解析Podfile,升级第三方框架

pod update

以后使用CocoaPods过程中出现了莫名其妙的问题

sudo gem update --system
sudo gem install cocoapods
pod setup

镜像备份网址

所有资源摘自李明杰老师

相关文章

网友评论

      本文标题:cocoapods使用步骤[MJ]

      本文链接:https://www.haomeiwen.com/subject/lwbzvftx.html