上端时间删除了一些东西 感觉太占内存了 如图
pods.png
安装吧 - 直接看报错后 因为前面是学习的时候 老版本了 镜像都有问题
- 查看现有镜像
gem source -l

- 先删除之前的 不可用的
gem sources --remove https://ruby.taobao.org/
gem sources --remove https://gems.ruby-china.org/

- 加入淘宝镜像
gem sources -a https://gems.ruby-china.com/

- 安装更新cocoapods
参考CocoaPods最新安装和问题解决教程(干货)我就参考这个安装问题尤其是安装命令
你要输入密码 ,等待一段时间,根据网速决定
OS X 10.11以前,在终端输入以下命令:
sudo gem install cocoapods
OS X 10.11以后,在终端输入以下命令:
sudo gem install -n /usr/local/bin cocoapods
pod命令行
-
pod init
先打开工程 然后cd命令进入工程 创建Podfile文件 先用文本打开 然后pod你想pod的第三方库
pod 'Masonry'

-
pod update / pod install
速度很快的
image.png
-
小插曲 安装后的cocopods到底占多大内存 这边截图几张留作以后参考
image.png
image.png
报错
- [!] CDN: trunk Repo update failed
[!] CDN: trunk Repo update failed - 72 error(s):
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/8/a/0/IQKeyboardManager/2.5.0/IQKeyboardManager.podspec.json Response: Couldn't connect to server
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/8/a/0/IQKeyboardManager/3.0.0/IQKeyboardManager.podspec.json Response: Couldn't connect to server
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/8/a/0/IQKeyboardManager/3.0.1/IQKeyboardManager.podspec.json Response: Couldn't connect to server
很多内容不复制了.....
参考[!] CDN: trunk Repo update failed、[!] CDN: trunk Repo update failed - 39 error(s):、CDN: trunk URL couldn't be downloaded
解决方案亲自尝试的:
1)sudo gem install -n /usr/local/bin cocoapods
sudo gem install -n /usr/local/bin cocoapods

-
在podfile文件添加内容
image.png
source 'https://github.com/CocoaPods/Specs.git'
-
如果直接pod update 出现 [!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
命令控制 pod install 先安装 后更新pod update -
[!] /user/bin/git https://github.com/Cocoapods/Specs.git -- mater
Cloning int 'master'
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL
其实吧 还是开梯子直接解决所有问题
升级cocopods
sudo gem install cocoapods
网友评论