Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用Pod在Mac中安装Alamofire时出错_Ios_Swift_Cocoapods_Alamofire - Fatal编程技术网

Ios 使用Pod在Mac中安装Alamofire时出错

Ios 使用Pod在Mac中安装Alamofire时出错,ios,swift,cocoapods,alamofire,Ios,Swift,Cocoapods,Alamofire,我正在尝试使用pod为iOS应用程序开发安装Alamofire。我的播客文件如下所示: # 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 d

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

# 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

有人能提出解决方案吗?

'403'表示禁止访问。有时,存储在计算机中的凭据会过时,尤其是在多个github帐户之间切换时。下面的解决方案可能有效

雨衣
  • 打开钥匙链应用程序
  • 在Keychain Access中,搜索github.com
  • 查找github.com的“internet密码”条目
  • 相应地编辑或删除条目
  • 窗户
  • 转到控制面板>用户帐户>凭据管理器>Windows凭据>通用凭据
  • 删除Github键

  • 你试过更新Cocoapod吗?这里的问题似乎是一样的:
    sudo gem install cocoapods
    @jalone cocoapods已经被删除了这是为了将其更新到最新版本,不仅仅是为了在运行命令后安装它:成功安装了cocoapods-1.8.4,但仍然是相同的错误