简体   繁体   English

CocoaPods安装挂起

[英]CocoaPods install hangs

I'm having issues with cocoapods, where pod install always hangs at Analyzing dependencies phase. 我在cocoapods上遇到问题,在此过程中, pod install始终挂在“ Analyzing dependencies阶段。 Running with --verbose flag shows that the hangup is always right after the Inspecting targets to integrate output. 使用--verbose标志运行表明,挂断始终在Inspecting targets to integrate输出之后。 I've tried playing with new projects as well as in my existing workspace created by liftoff. 我尝试过使用新项目以及在liftoff创建的现有工作区中进行游戏。 I also wanted to mention that I have not used CocoaPods in the past, so it's quite possible I'm doing something wrong. 我还想提及一下,我过去从未使用过CocoaPods,所以很有可能我做错了事。

This doesn't seem to be the same hangup error mentioned in a few other cocoapods threads here. 这似乎与此处其他一些cocoapods线程中提到的挂断错误不同。 None of the solutions mentioned in Cocoapods staying on "analyzing dependencies" work. Cocoapods中提到的解决方案都没有停留在“分析依赖项”上 I'm using CocoaPods version 0.37.2. 我正在使用CocoaPods版本0.37.2。

Here is what I'm doing: 这是我在做什么:

I used liftoff to create my workspace using swift template ( https://github.com/thoughtbot/liftoff ), it auto-generated a Podfile in global space, putting its own boilerplate in there. 我使用了liftoff使用swift模板( https://github.com/thoughtbot/liftoff )创建我的工作区,它在全局空间中自动生成了一个Podfile,并在其中放置了自己的样板。 I've modified it to add pod 'CocoaLumberjack' under the line that says 'Add application pods here', single workspace entry and xcodeproj entries for each of my projects similar to this podfile: https://github.com/dblock/ARASCIISwizzle/blob/master/Podfile (except that I did not yet add my own targets). 我已经对其进行了修改,以在pod 'CocoaLumberjack'在此处添加应用程序pod 'CocoaLumberjack'的行下添加pod 'CocoaLumberjack' ,与该容器文件类似的每个项目的单个工作区条目和xcodeproj条目: https : //github.com/dblock/ARASCIISwizzle / blob / master / Podfile (除了我还没有添加自己的目标)。 I also created a couple of my own projects from within XCode under the same workspace. 我还从同一工作区的XCode中创建了几个我自己的项目。 Projects compile and run fine as of now, no podfiles have been used by them yet. 到目前为止,项目可以编译并运行良好,但尚未使用任何podfile。

I followed up by running pod setup , which completed successfully. 我接着运行pod setup ,它成功完成了。 Afterwards, pod install always hangs, I checked activity monitor as well, to make sure it's not running git-remote-http on the background. 之后, pod install总是挂起,我也检查了活动监视器,以确保它不在后台运行git-remote-http。 I reran it with verbose, but it still hangs, here is what I'm seeing: 我以冗长的方式重新运行它,但是它仍然挂起,这是我所看到的:

▶ pod install --verbose
  Preparing

Analyzing dependencies

Updating spec repositories
Updating spec repo `master`
  $ /usr/bin/git pull --ff-only
  From https://github.com/CocoaPods/Specs
     03edf73..14f2ac3  master     -> origin/master
  Updating 03edf73..14f2ac3
  Fast-forward
   .../0.2.1/CNPPopupController.podspec.json          |  26 +++++
   Specs/CommonUtils/1.5.8/CommonUtils.podspec.json   |  67 ++++++++++++
   .../0.1.1/GBSimpleWebViewController.podspec.json   |  20 ++++
   Specs/Intercom/2.3.0/Intercom.podspec.json         |  40 +++++++
   .../3.0.4/Kite-Print-SDK.podspec.json              | 121 +++++++++++++++++++++
   .../MUKDataSource/2.0.3/MUKDataSource.podspec.json |  29 +++++
   .../MUKDataSource/2.0.4/MUKDataSource.podspec.json |  29 +++++
   Specs/PNChart/0.8.5/PNChart.podspec.json           |  39 +++++++
   .../StoryboardKit/0.1.0/StoryboardKit.podspec.json |  27 +++++
   9 files changed, 398 insertions(+)
   create mode 100644 Specs/CNPPopupController/0.2.1/CNPPopupController.podspec.json
   create mode 100644 Specs/CommonUtils/1.5.8/CommonUtils.podspec.json
   create mode 100644 Specs/GBSimpleWebViewController/0.1.1/GBSimpleWebViewController.podspec.json
   create mode 100644 Specs/Intercom/2.3.0/Intercom.podspec.json
   create mode 100644 Specs/Kite-Print-SDK/3.0.4/Kite-Print-SDK.podspec.json
   create mode 100644 Specs/MUKDataSource/2.0.3/MUKDataSource.podspec.json
   create mode 100644 Specs/MUKDataSource/2.0.4/MUKDataSource.podspec.json
   create mode 100644 Specs/PNChart/0.8.5/PNChart.podspec.json
   create mode 100644 Specs/StoryboardKit/0.1.0/StoryboardKit.podspec.json

Inspecting targets to integrate

At that point, CocoaPods stays on that last line indefinitely. 那时,CocoaPods无限期地停留在最后一行。 I've let it sit there overnight with no progress. 我让它整夜坐在那里,没有任何进展。 I've tried repeating this in another test project, created manually via XCode with me running pod setup and creating a Podfile myself with the following content: 我试过在另一个测试项目中重复执行此操作,该项目是通过XCode手动创建的,同时运行pod setup并自己创建具有以下内容的Podfile:

platform :ios, "6.0"
pod "CocoaLumberjack"

Once again, cocoapods hangs on the same step when I run pod install --verbose . 再次,当我运行pod install --verbose时,cocoapods挂在同一步骤上。

UPDATE: After banging my head against the wall for another day with this, I asked a friend with a Mac to try these instructions, which worked without problems on his laptop. 更新:用这种方法将我的头靠在墙上另一天后,我让一个Mac的朋友尝试这些说明,该说明在他的笔记本电脑上没有问题。 I tried looking at my other apps and shell config to see if anything could be having unfavorable interaction with cocoapods, with no luck. 我尝试查看其他应用程序和shell配置,以查看是否有任何东西与cocoapods发生不利的交互,没有运气。 I then created another user account, chown ed the project directory to new user, su ed to this user and repeated pod init and pod install from new user, both worked like a charm. 然后,我创建另一个用户帐户, chown编项目目录到新的用户, su主编给该用户反复pod initpod install来自新用户,无论是工作就像一个魅力。 I now suspect this is something in my .bashrc or profile, but have yet to figure out what. 我现在怀疑这是我的.bashrc或配置文件中的内容,但尚未弄清楚是什么。

You need to connect to the pod again by removing old setups. 您需要通过删除旧的设置来再次连接到Pod。

  $ pod repo remove master
  $ pod setup
  $ pod install

Try this it will solve your issue. 试试这个,它将解决您的问题。

Fixed this issue a while ago, but forgot to come back and post an update here. 不久前已解决此问题,但忘记了回来并在此处发布更新。

The problem ended up to be quite eccentric and perhaps unique to me (or those who do a lot of tinkering with their terminal shell). 这个问题最终变得非常古怪,也许对我来说(或那些对接线端子壳进行大量修改的人)是独一无二的。 I had a function named _ (underscore) in my .bashrc , which bash itself had no problem with (or at least it seemed like that until pod), zsh (the shell I use) did have a problem with it, breaking sudo command, but everything else seemed to work fine. 我在.bashrc有一个名为_ (下划线)的函数,该bash本身没有问题(或者至少在pod之前看起来好像没有问题),zsh(我使用的外壳)确实有问题,破坏了sudo命令,但其他一切似乎都正常。 pod was apparently affected by this as well. pod显然也受此影响。

So for those also experiencing this issue (and who have tinkered with their .profile, .bashrc, .zshrc), I would suggest checking for odd function names in your .bashrc or commenting out portions of it to see where the problem is. 因此,对于那些也遇到此问题的人(以及修改过.profile,.bashrc,.zshrc的人),我建议您检查.bashrc奇数函数名称,或注释掉其中的某些部分以查看问题出在哪里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM