第一次安装失败是由于Homebrew一直安装不成功,遂去http://brew.sh/index_zh-cn.html官网
通过
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
复制到终端中直接安装,安装成功后再通过RVM安装Ruby还是失败,根据提示输入brew doctor查找原因,发现时Xcode版本过低,更新安装之后并运行Xcode,再通过
rvm install 2.3.0
安装了Ruby,安装Ruby成功后输入按照常规步骤到
pod repo remove master出现如下错误
[!] repo master does not exist
尝试更换源,输入如下
pod repo add master http://git.oschina.net/akuandev/Specs.git出现如下错误
[!] To setup the master specs repo, please run `pod setup`.
切换源失败,根据提示输入pod setup
刚开始尝试很多次,都是如下错误
Setting up CocoaPods master repo
[!] /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master
Cloning into ‘master‘...
error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
通过网络查询很久后死马当活马医,很多人遇到
error: RPC failed; curl 56 SSLRead() return error -36
输入
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer就能pop setup成功
遂在终端输入如上
再进行pod setup,结果如下
Setting up CocoaPods master repo
CocoaPods 1.1.0.rc.2 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we‘d love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.1.0.rc.2
Setup completed 有了绿色的Setup completed即可
最后成功安装好Ruby
注:确保安装了Xcode命令行工具,忘记是在哪一步安装了此工具,在终端输入
xcode-select --install 即可安装,