今天换了一台新的mac 在使用的时候发现cocoapods不可以使用
安装cocoapods的时候提示这个错误
<code class="hljs http has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-attribute" style="box-sizing: border-box;">ERROR</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;"> Error installing cocoapods: activesupport requires Ruby version >= 2.2.2.</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
查看本机的版本
![](https://img-blog.csdn.net/20160913173429320?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
通过rvm安装ruby
1、安装 ram
想知道rvm是什么可以
RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems
1、安装指令
$ curl -L get.rvm.io | bash -s stable
![](https://img-blog.csdn.net/20160913175910463?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
2、检查 rvm 版本
rvm -v
查看ruby 版本
ruby -v $ rvm list known
安装
rvm install 2.3
检查安装ruby 版本
![](https://img-blog.csdn.net/20160913180420111?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
安装cocoapod
sudo gem install cocoapods
安装成功