OGeek|极客世界-中国程序员成长平台

标题: ios - 在虚拟机上安装 CocoaPods [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 14:02
标题: ios - 在虚拟机上安装 CocoaPods

我正在使用 OS X El Capitan,版本 10.11.4 使用 VMWare

我可以使用 sudo gem install cocoa pods

安装 gem

我想在我的项目中使用 Firebase 并遵循官方网站上提到的指南。

在安装 pod 时,我收到以下错误

pod install --verbose
 Preparing

Setting up CocoaPods master repo

Cloning spec repo `master` from `https://github.com/CocoaPods/Specs.git` (branch `master`)
  $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master
  Cloning into 'master'...
  error: RPC failed; curl 56 SSLRead() return error -9806
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
(/usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into 'master'...
error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
)
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/sources_manager.rb:35:in `rescue in find_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/sources_manager.rb:38:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer/analyzer.rb:654:in `block in sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer/analyzer.rb:653:in `map'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer/analyzer.rb:653:in `sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:144:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:114:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command/install.rb:37:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command.rb:50:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

到目前为止我已经尝试过什么

去 ~/.cocoapods/repos 并执行以下命令

git clone https://github.com/CocoaPods/Specs.git master

出现错误

Cloning into 'master'...
remote: Counting objects: 798955, done.
remote: Compressing objects: 100% (26/26), done.
~/.cocoapods/repos   9% (73183/798955), 14.57 MiB | 113.00 KiB/s

在上面一行之后它永远挂起,事件监视器上没有网络事件

此外,我通过执行增加了缓冲区大小

git config --global http.postBuffer 157286400



Best Answer-推荐答案


这是一个连接问题。 要解决此问题,您必须转到 VM 设置来桥接物理连接。

VMware Player-->可移动设备-->网络适配器-->设置

你会发现网络连接并检查两者

桥接:直接连接到物理网络

复制物理网络连接状态(如果您使用的是笔记本电脑)。

查看以下链接了解详情:

https://pubs.vmware.com/workstation-9/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-826323AD-D014-475D-8909-DFA73B5A3A57.html

关于ios - 在虚拟机上安装 CocoaPods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39199348/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4