公司给换新Mac后配置cocoaPods遇到的问题:
在安装Ruby执行 rvm install 2.3.0
时总是报错,
error信息:
fatal: could not set 'core.repositoryformatversion' to '0'
Failed during: git init -q
Requirements installation failed with status: 1.```
- ![屏幕快照 2017-03-11 下午9.30.09.png](http://upload-images.jianshu.io/upload_images/2135374-9a18414729746834.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
解决方法:
先执行: sudo chgrp -R admin /usr/local
再执行:sudo chmod -R g+w /usr/local
最后再执行:rvm install 2.3.0
刚开始执行上面3个命令时, 让我看到了希望+,
但中途还是出现error:
```==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4179, done.
remote: Compressing objects: 100% (4030/4030), done.
error: RPC failed; curl 56 SSLRead() return error -9806tes/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing: git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core
Failed during: /usr/local/bin/brew update --force
Requirements installation failed with status: 1.
最后执行此命令 成功 安装ruby
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
大概过了半小时,安装ruby成功
使用pod install时报错:
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSLRead() return error -9806
解决方法:
遇到这种问题的话,可以手动去克隆一份到repos目录下面。
步骤
1.通过finder的前往文件夹进行查看 ~/.cocoapods/repos
2.通过终端,进入到 ~/.cocoapods/repos
3.然后通过 git clone https://github.com/CocoaPods/Specs.git
还有其他问题的话,先看看是不是rubygem镜像源是不是被墙了,可以切换镜像源。
甚至,如果最终实在没办法,找到一个安装好了cocoapods的Mac电脑,到他的~/.cocoapods/repos目录下面拷贝出master文件到自己的Mac上的相应位置。