2021-05-20
https://blog.csdn.net/spicyShrimp/article/details/71424036
跟着这篇文章学习的。
途中遇到问题汇总一下
1、我的Mac的RVM坏了, 卸载重新安装
卸载RVM
首先是移除RVM是容易的。
rvm implode 或者 rm -rf ~/.rvm
其次是移除在.bashrc或.bash_profile中的如下脚本。
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
然后是移除/etc/rvmrc文件。
rm -rf /etc/rvm*
最后是移除RVM创建的用户组。
groupdel rvm
2检查是否安装
rvm -v
3安装
curl -L get.rvm.io | bash -s stable //需要等一会
source ~/.bashrc (这句我没写,也行,不知道干嘛用的)
source ~/.bash_profile (这句我没写,也行,不知道干嘛用的)
rvm -v ,如果能显示版本则安装成功

最后执行 source /etc/profile.d/rvm.sh (到时候对应位置会有提示,文件名肯定会不一样)便安装完成了
3ruby换源的问题
1 要翻墙可能才行 (我就遇到404访问出错了)
2 换源
sudo gem update –system
gem sources –remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/ (这里是.com了, 我用.org的时候不行)
gem sources -l
错误像这样-------------------------------------
bad response Not Found 404
对于404问题
Error fetching https://ruby.taobao.org/:
bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)
先访问一下https://ruby.taobao.org/是否能够成功再来测试也可以。
如果网页访问提示了镜像地址已经改变,就需要更换地址。
https://gems.ruby-china.com/
————————————————
还会出现下面这个问题选择以后就Ok啦
安装ruby环境出现Failed to build gem native extension的解决办法

4然后安装cocoaspods 因为我用的不好, 他说的不详细, 下方讲的详细
http://www.cocoachina.com/articles/21815
然后你的项目就使用上了cocoaspod 来管理项目了
额外cocospod 使用方法
https://www.jianshu.com/p/f43b5964f582
网友评论