Carthage更新错误:“GitHub API请求失败:凭据错误”

时间:2016-03-04 07:41:48

标签: swift realm carthage

这是我的Cartfile:

# 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凭据的错误。有什么问题?

2 个答案:

答案 0 :(得分:3)

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

  1. 修改~/.gitconfig并添加以下内容:

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

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

  2. 通过HTTPS克隆私人仓库。

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

  4. 运行carthage update

答案 1 :(得分:1)

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

carthage update --no-use-binaries