前言
按照之前的一贯安装方法:
指定源:
1 | $ gem sources --remove https://rubygems.org/ |
结果报错如下:
1 | ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why: |
然后升级了下ruby:
1 | $ sudo gem update --system |
然后升级到了 2.6.14,继续安装:
1 | $ gem install cocoapods |
然而,错误又来了:
1 | YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0). |
只好Google了下,然后准备用rvm重新安装ruby
1 | $ curl -L get.rvm.io | bash -s stable |
终端显示:
1 | % Total % Received % Xferd Average Speed Time Time Time Current |
然后:
1 | $ source ~/.bashrc |
查看ruby版本:
1 | $ ruby -v |
列出rvm下所有ruby版本:
1 | $ rvm list known |
安装ruby:
1 | $ rvm install 2.4.1 |
时间有点久:
1 | Searching for binary rubies, this might take some time. |
安装成功之后就可以安装CocoaPods了:
1 | $ sudo gem install cocoapods |
输入密码,很快安装好了。
1 | Password: |
接着就是 安装一些第三方库,足足等了几个小时。。。1
2
3
4
5
6
7
8$ cd #项目目录#
zhouhuipingdeMacBook-Pro:JieNiuLife zhouhuiping$ pod install
Setting up CocoaPods master repo
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 1646580, done.
remote: Compressing objects: 100% (922/922), done.
Receiving objects: 10% (179069/1646580), 35.62 MiB | 27.00 KiB/s