1.终端执行:
pod repo push dzw_git DFCategory.podspec --allow-warnings --use-libraries
遇到以下错误:
DFCategory.podspec文件验证失败
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/a/a/4/Masonry/0.0.3/Masonry.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)
2.原因:
CocoaPods 自 1.8 版本开始默认使用 trunk CDN (https://cdn.cocoapods.org/) 作为 spec 的源,避免了需要本地 clone 一份庞大的 Specs 仓库导致每次 update 都要全量更新的问题。但是国内连trunk CDN 被限制访问了。
3.解决方案:
podFile文件里更改指定source为:https://cdn.cocoapods.org/
(仅针对1.8及以上版本,老版本可以继续使用source:https://github.com/CocoaPods/Specs.git
), 然后指定
执行pod repo list
命令。可以看到 master
库,
执行pod repo remove master
,移除以后执行第1步的命令重新提交就好。
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/dingzhiwei/.cocoapods/repos/master
trunk
- Type: CDN
- URL: https://cdn.cocoapods.org/
- Path: /Users/dingzhiwei/.cocoapods/repos/trunk
网友评论