Carthage update error: "GitHub API request failed: Bad credentials"

Carthage update error: "GitHub API request failed: Bad credentials"

这是我的购物车文件:

# Kanna HTML parsing library
github "tid-kijyun/Kanna" ~> 1.0.0

# Realm database/ORM
github "realm/realm-cocoa"

当我 运行 carthage update 我得到这个:

$ carthage --version
Unrecognized command: '--version'. See `carthage help`.

$ carthage update --platform OSX
*** Fetching realm-cocoa
*** Fetching Kanna
*** Skipped downloading realm-cocoa.framework binary due to the error:
    "GitHub API request failed: Bad credentials"
*** Checking out realm-cocoa at "v0.98.3"
*** Skipped downloading Kanna.framework binary due to the error:
    "GitHub API request failed: Bad credentials"
*** Checking out Kanna at "1.0.5"
*** xcodebuild output can be found in /var/folders/p2/c_d5mx0s3gl45165btrpx1fm0000gn/T/carthage-xcodebuild.KVYEob.log
*** Building scheme "Kanna_OSX" in Kanna.xcworkspace
*** Building scheme "RealmSwift" in RealmExamples.xcworkspace
*** Building scheme "Realm" in RealmExamples.xcworkspace

所以它似乎同时构建了 Kanna 和 Realm,但是我收到了关于错误 GitHub API 凭据的错误。怎么了?

我得到了回应 Carthage issue 我提出的解决方案:

  1. 编辑 ~/.gitconfig 并添加以下内容:

    [credential] helper = osxkeychain [credential "https://github.com"] username = willhains

    (将 willhains 替换为您的 GitHub 用户 ID。)

  2. 通过 HTTPS 克隆私有存储库。

  3. OSX 将提示您输入 GitHub 密码。

  4. 运行 carthage update.

如果您想跳过查找二进制文件而只是从源代码构建:

carthage update --no-use-binaries