怎么彻底删除ruby1.8,换成1.9

Python011

怎么彻底删除ruby1.8,换成1.9,第1张

1、执行ruby -v确定版本2、执行whereis ruby找到ruby安装的位置。可能有多个位置。将每一个path的ruby都执行一下-v。比如 /usr/bin/ruby -v。看下哪个是你安装的1.9.3版本。假如就是/usr/bin/ruby

3、编辑/etc/profile,在最末尾添加一行:export PATH=/usr/bin/ruby:$PATH

4、执行source /etc/profile。然后再执行下ruby -v试下

ruby 的命令是可以使用的,可以查看 ruby 的版本

输入ruby --version

可以查看到

就是 cocoapods 的任何命令使用不了,

按照网上的教程(https://www.jianshu.com/p/45f2ec14644b)重装,还是使用不了 ,还是报错

Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path

解决方法:到 Git 官网下载 Git安装即可:

https://git-scm.com/download/mac

参考这篇文章 https://www.jianshu.com/p/571fdf4547e5

备注:

重装cocoapods的时候,升级 rvm 的时候 执行 curl -L get.rvm.io | bash -s stable 报错

解决方法:

将上面的命令行改成:\curl -sSL https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash