【问题标题】:Error installing Alamofire in Mac Using Pod使用 Pod 在 Mac 中安装 Alamofire 时出错
【发布时间】:2019-11-05 10:31:02
【问题描述】:

我正在尝试使用 pod 为 iOS 应用程序开发安装 Alamofire。我的 podfile 如下所示:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'AlamoFireBackgroundTask' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'Alamofire'
  # Pods for AlamoFireBackgroundTask

end

当我跑步时

pod install

我收到以下错误消息:

[!] Error installing Alamofire
[!] /usr/bin/git clone https://github.com/Alamofire/Alamofire.git /var/folders/0f/tk8t38hn0pq_81glyqfgsp6m0000gn/T/d20191105-77916-ujlfnd --template= --single-branch --depth 1 --branch 4.9.1

Cloning into '/var/folders/0f/tk8t38hn0pq_81glyqfgsp6m0000gn/T/d20191105-77916-ujlfnd'...
error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403 Forbidden
fatal: the remote end hung up unexpectedly

谁能提出解决方案?

【问题讨论】:

  • 你试过更新 cocoapods 吗?这里似乎是同一个问题:stackoverflow.com/questions/21678386/…
  • sudo gem install cocoapods
  • @jalone cocoapods 已安装
  • 那是为了更新到最新版本,而不是仅仅为了安装它
  • 运行命令后:成功安装cocoapods-1.8.4但还是同样的错误

标签: ios swift cocoapods alamofire


【解决方案1】:

‘403’表示禁止访问。有时,您存储在机器中的凭据会变得陈旧,尤其是当您在多个 github 帐户之间切换时。以下解决方案可能有效,

Mac

  1. 打开钥匙串应用程序
  2. 在 Keychain Access 中,搜索 github.com
  3. 找到 github.com 的“互联网密码”条目
  4. 相应地编辑或删除条目

窗口

  1. 转到控制面板 > 用户帐户 > 凭据管理器 > Windows 凭据 > 通用凭据
  2. 移除 Github 密钥

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-15
    • 1970-01-01
    • 2016-09-13
    • 1970-01-01
    • 2019-01-20
    相关资源
    最近更新 更多