CocoaPods安装

1。安装

 

# 删除源(这个系统自带的不好用)

$ sudo gem sources -r https://rubygems.org/

 

# 添加源(使用淘宝的镜像,记住要用https)

$ sudo gem sources -a https://ruby.taobao.org/

 

# 查看是否使用的是淘宝镜像

$ gem sources -l

 

# 安装

$ sudo gem install cocoapods

 

# 安装成功之后,查看是否是最后版本(目前最新版本是0.39.0)

$ pod --version

 

 

 

2.安装过程中常见的问题

 

[!] Pod::Executable clone

'https://github.com/CocoaPods/Specs.git' master

 

xcrun: error: active developer path

("/Users/xiakejie/工具/Xcode 2.app/Contents/Developer")

does not exist, use xcode-select to change

 

解决上面这个问题, 使用这个命令: sudo xcode-select -switch

/Applications/Xcode.app/Contents/Developer

使用

原文地址:https://www.cnblogs.com/Ruby-Hua/p/6096574.html