这是本人在macOS Sierra 10.12.6版本上安装cocoapods所遇到的一些问题,做个记录。
开始安装时报错误代码:YAML safe loading is not available.Please upgrade psych to version that supports safe loading(>=2.0) 。后面上网百度了一些方法,但执行命令rvm install 2.4.1 时始终出现需要查看日志的问题。这时执行命令 xcode-select --install 安装 XCode 插件,即可搞定。
下面是完整方法:
1.使用ruby --version查看ruby的安装版本,我的是ruby 2.0.0p648 (2015-12-16 revision 53162)
2.使用gem list命令查看psych的安装版本,我的是 psych (default: 2.0.0)
3.使用rvm list known命令行查看更高版本 ruby,报错-bash: rvm: command not found
4.安装rvm,使用命令行curl -Lget.rvm.io| bash -s stable,如果报错,按要求在.bash_profile中写入source ~/.profile
5.执行source ~/.bashrc和source ~/.bash_profile
6.执行rvm list known命令查看更高 ruby 版本,并使用rvm install 2.4.1安装
7.如果出现需要查看日志的问题,则执行xcode-select --install安装 XCode 插件
8.安装完毕后执行rvm reinstall ruby-2.4.1,安装完毕后查看 ruby 版本,看是否升级到2.4.1
参考链接:https://www.zhihu.com/question/66800711/answer/252905866
网友评论