运行更新时如何解决macOS迦太基挂起的问题? [英] How do I resolve macOS Carthage hangs when running update?

查看:135
本文介绍了运行更新时如何解决macOS迦太基挂起的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开始从事一个新项目,在该项目中,我需要运行迦太基更新"来处理私有和公共项目的混合,其中一些项目包含子模块.不管我做什么,迦太基都挂死了,没有任何原因.我该怎么做才能确定死机,然后如何解决这些问题?

Started working on a new project where I need to run "Carthage update" for a mix of private and public projects some of which have submodules. No matter what I do Carthage hangs with no indication of why. What can I do to determine the hangs, and then how do I fix those problems?

推荐答案

我为解决自己的问题所做的许多工作都可以在其他地方找到,但是没有一个站点拥有全部功能.最后,我使用了一种我找不到但猜到的技术.

Much of what I did to solve my problems can be found elsewhere, but no one site had it all. In the end I used a technique that I did not find but guessed at.

我遇到的根本问题是为我的github帐户采用建议的安全保护:两阶段身份验证和ssh的密码短语.这两种方法都可以解决,但是不幸的是,Cathage没有提供冗长"的选项来让用户确定它正在执行的git命令-当挂起时,该选项确实会对用户有所帮助.就我而言(可能还有其他大多数情况),根本问题是迦太基运行的git命令想要提示用户某些东西,而迦太基已关闭或重定向了标准输出.

The root problem I had was adopting recommended security protection for my github account: two stage authentication and a passphrase for ssh. Both of these can be worked around, but unfortunately Cathage offers no "verbose" option to let a user determine what git commands it's executing - an option that would really help the user when it hangs. In my case (and probably most others) the root problem is that a git command run by Carthage wants to prompt the user for something, and Carthage has closed or redirected standard output.

1)Sierra和Git帐户/密码

1) Sierra and Git account/passwords

最近的Sierra点发行版似乎改变了git凭据的缓存方式.现在执行此操作的正确方法是使用钥匙串.在此处找到有关如何指导git使用钥匙串的过程. .请注意,此技术仅适用于纯帐户/密码"身份验证.

It seems that a recent Sierra point release changes how git credentials are cached. The proper way to do this now is using the Keychain. The procedure on how to direct git to use the Keychain is found here . Note that this technique only works for pure "account/password" authentication.

甚至在尝试迦太基之前,请确保可以在终端上使用git clone以确保一切正常.

Before even trying Carthage, insure you can use git clone from the terminal to be sure all is well.

2)两步身份验证

在这种情况下,您需要使用身份验证令牌.该令牌用于代替git密码.同样,请确保您可以在尝试迦太基之前克隆适当的存储库.

In this case, you need to use an authentication token. That token is used in place of the git password. Again, insure you can clone an appropriate repository before trying Carthage.

3)用于ssh访问的密码短语

3) Passphrase for ssh access

如果git使用ssh(子模块可能会使用ssh),则git将尝试提示输入密码短语,并且由于迦太基抑制了您的工作而将其挂起.通过在您的~/.ssh/config文件中添加一行(并在文件的底部进行此操作)

If git uses ssh (as it may with sub-modules), then git will attempt to prompt for the passphrase, and as Carthage suppresses that you'll be left hanging. By adding a line to your ~/.ssh/config file (and do this at the BOTTOM of the file)

Host *
    UseKeychain yes

git还将使用

git will also use the Keychain for saving and retrieving the passphrase. You need to do this once via the Terminal to get it entered into the Keychain.

4)仍然卡住了吗?

如果上述方法对您没有帮助,则在Carthage挂起时,打开一个新的终端窗口并运行ps -aef | grep git;然后您将看到一些git命令.希望您会像我一样看到一个git clone命令;将该命令复制到剪贴板.

If the above techniques don't help you, when Carthage hangs open a new terminal window and run ps -aef | grep git; what you'll then see are a few git commands. Hopefully you will see a git clone command as I did; copy that command to the clipboard.

杀死Carthage命令,然后将该行粘贴到Terminal中并运行该命令(也许通过编辑以删除多余的选项),然后看看会发生什么.幸运的是,您发现的东西将帮助您解决问题.

Kill the Carthage command, then paste the line in Terminal and run the command (perhaps by editing it to remove extraneous options), and see what happens. With luck what you find will help you resolve your problem.

这篇关于运行更新时如何解决macOS迦太基挂起的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆