7

I already have one project working with a podfile.

I wanted to add a Podfile on an old project but I got this error on sudo pod install

Error:

Resolving dependencies of `./Podfile'
Updating spec repositories
[!] git pull
Updating 35bbbaf..8b42708
error: The following untracked working tree files would be overwritten by merge:

AFXAuthClient/1.0.4/AFXAuthClient.podspec

Please move or remove them before you can merge.

Aborting

It's weird because I don't use AFXAuthClient on my project, and I never used it.

Here's my Podfile:

platform :ios, '5.0'
pod 'TTTAttributedLabel',  '~> 1.6.0'
pod 'ECSlidingViewController',  '~> 0.9.0'

I tried to made without success:

gem install cocoapods
pod setup

NB: I get the same error with pod setup

animuson
  • 53,861
  • 28
  • 137
  • 147
Alexis.J
  • 149
  • 3
  • 10

2 Answers2

34

From the command line run rm -rf ~/.cocoapods

Then run pod install again. You shouldn't need the sudo.

This look like it's caused because there was a change to a spec and it's conflicting with running a git pull

Keith Smiley
  • 61,481
  • 12
  • 97
  • 110
  • 1
    I too can't merge after installed new version cocoapods, this helped me. Thx Keith! – Bimawa Apr 02 '13 at 02:18
  • hi , i am confused with your statement ,can you help me what is mean of "This look like it's caused because there was a change to a spec and it's conflicting with running a git pull" your answer ? – user1409935 Dec 19 '13 at 05:57
  • When the `pod` tool is updating its sources with the master specs repo it runs a `git pull` and it failed while it was doing that, most likely because something had been changed, probably not intentionally causing the pull to fail because it would otherwise be overwritten. – Keith Smiley Dec 19 '13 at 14:44
  • The team is wrestling with a bug in libgit2 -http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ – Piper May 01 '14 at 15:36
  • That was a while ago. Hopefully we're past that at this point. – Keith Smiley May 01 '14 at 15:37
3

If you're seeing an error like this, it might be because CocoaPods had to force-push their repo. They suggest:

pod repo remove master
pod setup
Jesse Rusak
  • 56,530
  • 12
  • 101
  • 102