You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级macOS Ventura后执行pod install遇GitHub连接超时求助

解决Mac Ventura升级后pod install因GitHub连接超时失败的问题

问题定位

报错核心是git clone GitHub仓库时连接超时(errno=Operation timed out),属于网络或Git配置层面的问题,和Ventura升级后的网络环境、配置重置有关。

解决方案

  • 测试网络连通性并调整DNS

    1. 执行ping github.com,如果返回超时,先修改系统DNS:
      • 打开「系统设置」→「网络」→ 选中当前网络→「详情」→「DNS」
      • 添加公共DNS:8.8.8.8(Google)或1.1.1.1(Cloudflare),移除旧DNS
    2. 重新执行ping github.com,确认能正常连通后再尝试pod install
  • 清理Git代理配置
    Ventura升级可能导致旧代理配置失效,执行以下命令重置:

    git config --global --unset http.proxy
    git config --global --unset https.proxy
    

    如果需要使用代理,重新设置正确的代理地址(替换为你的代理端口):

    git config --global https.proxy http://127.0.0.1:xxxx
    
  • 重置CocoaPods缓存
    清理旧缓存后重新安装:

    pod cache clean --all
    rm -rf Podfile.lock Pods
    pod install
    
  • 改用SSH协议克隆仓库
    如果HTTPS协议始终无法连通,切换到SSH:

    1. 生成SSH密钥(如果没有):
      ssh-keygen -t ed25519 -C "your_email@example.com"
      
    2. 将~/.ssh/id_ed25519.pub中的内容添加到GitHub账户的「SSH and GPG keys」列表中
    3. 配置Git自动替换HTTPS为SSH:
      git config --global url."git@github.com:".insteadOf "https://github.com/"
      
    4. 重新执行pod install
  • 检查系统防火墙
    确认Ventura防火墙未阻止Git联网:

    • 打开「系统设置」→「隐私与安全性」→「防火墙」→「防火墙选项」
    • 检查git(路径通常为/usr/local/bin/git)是否被允许联网,若未添加则手动允许

内容的提问来源于stack exchange,提问作者MacPhi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 01:20:20