由于项目是用CocoaPods管理,CocoaPods 1.8将CDN切换为默认的spec repo源,并附带一些增强功能!CDN支持最初是在1.7版本中引入的,最终在1.7.2中完成。 它旨在大大加快初始设置和依赖性分析。
目前项目使用pods的是1.8.4版本
zhoulangkejideiMac:iosAndVue linmac$ pod --version
1.8.4
使用pods出现
[!] CDN: trunk Repo update failed - 27 error(s):
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/a/a/4/Masonry/0.0.2/Masonry.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)
按照官方文档 podfile文件中添加source源:
source 'https://github.com/CocoaPods/Specs.git'
podfile文件中添加source源后,pod install和pod update可以正常操作,但是pod search有些库却不正常。
zhoulangkejideiMac:iosAndVue linmac$ pod search MBProgressHUD
[!] CDN: trunk Repo update failed - 10 error(s):
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/c/8/7/MBProgressHUD/0.5/MBProgressHUD.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/c/8/7/MBProgressHUD/0.6/MBProgressHUD.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/c/8/7/MBProgressHUD/0.7/MBProgressHUD.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)
解决办法:
- podfile文件中指定source源为master:
source 'https://github.com/CocoaPods/Specs.git'
2.执行pod repo remove trunk移除trunk源
执行完后,pod search就都正常了!
zhoulangkejideiMac:iosAndVue linmac$ pod search MBProgressHUD
-> MBProgressHUD (1.1.0)
An iOS activity indicator view.
pod 'MBProgressHUD', '~> 1.1.0'
- Homepage: http://www.bukovinski.com
- Source: https://github.com/matej/MBProgressHUD.git
- Versions: 1.1.0, 1.0.0, 0.9.2, 0.9.1, 0.9, 0.8, 0.7, 0.6, 0.5
[edu-git-cocoapods-specs repo]
-> MBProgressHUD+Add (0.0.2)
给UIView和UIViewController添加HUD扩展,以便使用.
pod 'MBProgressHUD+Add', '~> 0.0.2'
- Homepage: https://github.com/ONECATYU/MBProgressHUD-Add
- Source: https://github.com/ONECATYU/MBProgressHUD-Add.git
- Versions: 0.0.2, 0.0.1 [edu-git-cocoapods-specs repo]
-> MBProgressHUD+BWMExtension (1.0.1)
注意:podfile文件中一定要指定master源,因为现在默认是trunk源
source 'https://github.com/CocoaPods/Specs.git'