cocoapods 1.8后默认的spec repo源从原来的master切换到CDN,查看当前cocoapods版本
pod --version
运行pod install出现以下错误
[!] CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/d/1/8/CocoaLumberjack/2.4.0/CocoaLumberjack.podspec.json Response: Couldn't connect to server
按照官方文档 podfile文件中添加source源:source 'https://github.com/CocoaPods/Specs.git'
podfile文件中添加source源后,pod install
和pod update
可以正常操作,但是pod search
有些库却不正常。
解决办法:
1. podfile文件中指定source源为master:
source 'https://github.com/CocoaPods/Specs.git'
2.执行pod repo remove trunk
移除trunk源
执行完后,pod search
就都正常了!