前面没用的说明:今天在github上下了个高仿今日头条的源码想学习一下,不料打开运行出错显示错误,查看发现是要用cocoapods安装各种插件。于是百度搜了cocoapods安装教程(其实之前电脑安装过的,换了新的电脑里面没有),走了一些弯路,在这里标记一下供各位参考学习。
终端输入:
1.sudo gem update -n /usr/local/bin --system
注:升级Ruby环境
成功提示:Latest version already installed. Done.
2.gem sources --remove https://rubygems.org/
3.gem sources -a https://gems.ruby-china.org/
注:更换源
- gem sources -l
成功提示:
*** CURRENT SOURCES ***
https://gems.ruby-china.org/
5.sudo gem install -n /usr/local/bin cocoapods
注:安装cocopods,成功提示:28 gems installed
6.pod setup
成功提示:Setup completed