一.检查rvm安装环境:
1.终端输入 rvm -v
2.存在返回 rvm +版本号,
3.不存在的话返回-bash: rvm: command not found。那么你 就要安装rvm
终端输入: curl -L https://get.rvm.io | bash -s stable
二、ruby
1.终端输入 gem source
2.结果为
*** CURRENT SOURCES ***
https://gems.ruby-china.com/
是正确的,则其余的都是错误的。
3.删除gem source --remove https://www.xxx.org/
添加gem source -a https://gems.ruby-china.com/
显示下面内容为成功,否则为失败
https://gems.ruby-china.com/ added to sources
4.如果出现错误的Failed to build gem native extension可按这个老哥的方法亲测有效:https://blog.csdn.net/bellazhouyi/article/details/99433149
三.安装cocoapods
1.输入 sudo gem install cocoapods
显示最后一行为gem installed 为成功
2.pod setup
出现其他颜色字体:setup complted则安装成功