Cocoapods 升级最新版本CDN异常问题(1.9.1)解决方案

释放双眼,带上耳机,听听看~!

 

Cocoapods 升级最新版本CDN异常问题(1.9.1)解决方案

    • 解决办法

Cocoapods 1.7.2 版本开始增加 CDN 支持但默认没有启用,
1.8 版本的发布舍弃了原始完整克隆的 Specs 仓库,改用 CDN 服务。

安装最新版本 Cocoapods 报错提示如下:

Errno::ENOENT - No such file or directory - /Users/rwx-mac/Desktop/He/HeAmap/Pods/AMapSearch/AMapSearchKit.framework/Resources
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:906:in `stat'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:906:in `symbolic_modes_to_i'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:927:in `fu_mode'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:1001:in `block (2 levels) in chmod_R'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:1466:in `preorder_traverse'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:999:in `block in chmod_R'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:998:in `each'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/fileutils.rb:998:in `chmod_R'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:117:in `block in prepare'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/lib/cocoapods/user_interface.rb:140:in `message'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:116:in `prepare'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:103:in `install!'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:101:in `run'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/lib/cocoapods/command.rb:48:in `run'
/Users/rwx-mac/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-0.38.2/bin/pod:44:in `<top (required)>'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `load'
/Users/rwx-mac/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `<main>'
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?
q=No+such+file+or+directory+-+%2FUsers%2Frwx-mac%2FDesktop%2FHe%2FHeAmap%2FPods%2FAMapSearch%2FAMapSearchKit.framework%2FResources&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!

解决办法

1,首先要安装 Xcode 命令行工具
xcode-select --install

2,查看版本
pod --version

3,查看gem源
gem sources

如果不是源:https://gems.ruby-china.com ,使用以下方式增加新源:
添加源
gem sources -a https://gems.ruby-china.com

删除之前的源
gem sources --remove https://gems.ruby-china.org/

然后查看源:
gem sources

4,使用源安装CocoaPods库
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master

如果特别慢,使用以下源安装CocoaPods库
git clone https://gitee.com/mirrors/CocoaPods-Specs.git ~/.cocoapods/repos/master

然后执行以下命令:
pod setup

使用CocoaPods:
打开podfile文件 指定旧方式下载。
// source 源地址
source ‘https://github.com/CocoaPods/Specs.git’

例如:

platform :ios,9.0’
source 'https://github.com/CocoaPods/Specs.git'
target '项目target名' do
pod 'AFNetworking', '~> 3.1.0'
end

然后执行命令:
pod install

理论上讲:以上可以解决新版本1.9.1 CocoaPods安装异常的问题。


如果以上不能解决问题,可尝试卸载CocoaPods,重新安装指定版本的CocoaPods。(折腾啊)

卸载CocoaPods
sudo gem uninstall cocoapods (卸载当前的CocoaPods)

指定版本号安装CocoaPods
sudo gem install cocoapods -v 0.38.1 (安装0.38.1版本号的CocoaPods)


如果出现其他的问题:也可以尝试一下:
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to storage.googleapis.com:443

移除代理
git config --global --unset http.proxy
git config --global --unset https.proxy


 

人已赞赏
iOS文章

iOS H5原生WKWebView调起支付宝客户端支付方案

2020-5-16 22:46:49

iOS文章

iOS修改项目名称,(综合网上全部资料,几步完美项目名字修改),iOS修改工程名称

2020-5-17 0:01:55

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索