http://blog.csdn.net/fairytale_1/article/details/51850734
http://www.cnblogs.com/gongyuhonglou/p/5801681.html
http://blog.csdn.net/txz_gray/article/details/52181637
http://blog.csdn.net/u010731949/article/details/51821862
补充:已经安装的是淘宝ruby镜像https://ruby.taobao.org/
具体配置cocoapods的步骤不说了,这里说一下这个问题吧,显然是ruby版本太低,要求 2.2.2以上
解决它吧,去把ruby版本号搞成>=2.2.2:
强烈建议 使用rvm安装ruby
rvm install ruby-2.2
- 1
但是,但是竟然报错了,具体我忘记额,但是是权限和brew的问题,那么我又转向修复brew:
// 清理原来brew
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
// 安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
// 检查有无问题
brew doctor
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
具体过程见http://digitizor.com/install-homebrew-osx-el-capitan/
brew解决后,我赶紧去试试rvm install ruby-2.2,但是提示:
Already installed ruby-2.2.4.
To reinstall use:
rvm reinstall ruby-2.2.4
- 1
- 2
- 3
- 4
OK,换成rvm reinstall ruby-2.2.4,成功,再去试试安装cocoapods
sudo gem install -n /usr/local/bin cocoapods --pre
- 1
成功!
参考:http://*.com/questions/36402189/installing-cocoapods-on-os-x-el-capitan-error