97

I have a working project the uses a pod file for some weeks now. When I learned that some of my pods have update I tried to 'pod install' on got this weird error

    Analyzing dependencies
    [!] Pod::Executable pull

    Updating 1337455..e9f6e93
    error: The following untracked working tree files would be overwritten by merge:

AeroGear-Push/0.7.0/AeroGear-Push.podspec

AeroGear/1.2.0/AeroGear.podspec

BrynKit/1.3.0/BrynKit.podspec

BrynKit/1.3.1/BrynKit.podspec

CSURITemplate/0.3/CSURITemplate.podspec

EXiLE/1.0.2/EXiLE.podspec

FlurrySDK/4.2.3/FlurrySDK.podspec

FoundationExtension/0.39.1/FoundationExtension.podspec

FoundationExtension/0.39/FoundationExtension.podspec

GCDObjects/0.0.1/GCDObjects.podspec

HTAutocompleteTextField/1.2.1/HTAutocompleteTextField.podspec

HTAutocompleteTextField/1.2.2/HTAutocompleteTextField.podspec

HTAutocompleteTextField/1.2/HTAutocompleteTextField.podspec

IDMPhotoBrowser/1.1.2/IDMPhotoBrowser.podspec

Igor/0.5.0/Igor.podspec

KFOpenWeatherMapAPI/0.2.0/KFOpenWeatherMapAPI.podspec

NGSegmentedViewController/0.1.1/NGSegmentedViewController.podspec

PPiFlatSegmentedControl/1.3/PPiFlatSegmentedControl.podspec

PiwikTracker/2.0.0/PiwikTracker.podspec

SDWebImage/3.4/SDWebImage.podspec

libwbxml/0.11.2/libwbxml.podspec

wbxml/0.0.1/wbxml.podspec

    Please move or remove them before you can merge.

    Aborting

another post suggested using the 'rm -rf ~/.cocoapods' command line but this caused my cocoapods to stop working all together for all project now which ever project I try to 'pod install' I get the 'Unable to find a specification for..' error

[!] Unable to find a specification for CorePlot (= 1.3).

Community
  • 1
  • 1
Matan Poreh
  • 2,271
  • 2
  • 16
  • 9
  • I had this issue after I was messing around and deleted a framework directory under the `Pods/` directory. – eremzeit Jan 30 '14 at 19:32

11 Answers11

235

If you landed here on or after January 30th 2014, there is a break in CocoaPods causing this. Please read the related blog post found here: http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/

or do:

pod repo remove master
pod setup
Mark Edington
  • 6,484
  • 3
  • 33
  • 33
109

The solution is to use $sudo rm -rf ~/.cocoapods to clean the cocoapods master repo and then pod install worked without any problems.

starball
  • 20,030
  • 7
  • 43
  • 238
Matan Poreh
  • 2,271
  • 2
  • 16
  • 9
19

The 100% dead-work one-line command is:

sudo rm -rf ~/.cocoapods && pod setup && pod install

I created the issue on GitHub traker:#2185

And the official answer is:

This is issue which has already been fixed by @irrationalfab with commit CocoaPods/CLAide@5e023ab. So the fix should be available in the next release of CocoaPods. Just be patient

skywinder
  • 21,291
  • 15
  • 93
  • 123
16

If you need a clean master spec repo you can try

cd ~/.cocoapods/master
git reset --hard

or if you're on CocoaPods 0.23+, use ~/.cocoapods/repos/master.

Adam Sharp
  • 3,618
  • 25
  • 29
  • This didn't quite work for me. I'm not sure how the subrepos for each project are setup by cocoapods, but just calling `git reset --hard` at the root repo didn't reset the changes that had been made to one of the child repos. I ended up just removing my `.cocoapods` directory and starting over, though not everyone would be in the position to do this. – eremzeit Jan 30 '14 at 19:41
  • @eremzeit what do you mean by child repos? – Adam Sharp Jan 30 '14 at 23:45
  • Doing this might also work for you: (1) `git fetch origin` (2) `git clean -f` (3) `git reset --hard origin/master` – Shiki Jan 31 '14 at 01:08
8

You are going to have to manually delete any local copies of the Specs repository and re-clone the new version of the Specs repository. You can do that with the following commands: $ sudo rm -fr ~/.cocoapods/repos/master $ pod setup

joserock85
  • 462
  • 1
  • 11
  • 16
7

when my projects get big and I have a large pod file, I run into this problem quite a bit.

My solution is as follows :

pod repo remove master
pod setup
pod install
Benjamin
  • 8,128
  • 3
  • 34
  • 45
2

You need to fix permissions and files owner

$ sudo chown -R user ~/Library/Caches/CocoaPods
$ sudo chown -R user ./Pods
$ sudo chown -R user ./Podfile.lock
$ sudo chmod -R 777 ./Pods

$ pod update/setup
Tim Kozak
  • 4,026
  • 39
  • 44
  • 1
    Yes! That's, what I need! Any other methods helps only for a once "pod install: operation. Right now everything works great, thanks! – skywinder May 07 '14 at 22:04
2

Wow this one has been a real pain and everyone seems to have a different solution. For me this solution worked on multiple machines/environments on a few occasions:

Apparently there is a bug with psych that is causing the problem.

sudo gem uninstall psych
sudo gem install psych -v 2.0.0

There's a lengthy conversation over on the CococaPods repo about the issue and this fix.

LunaCodeGirl
  • 5,432
  • 6
  • 30
  • 36
0

Just to share my own fix for this issue:

Since this is a git issue, you can use simple git commands to resolve it (See @AdamSharp's post). What worked for me was running

git clean -d -f

in ~/.cocoapods/repos/master. This recursively removes any untracked files and directories from the repo. I encourage you to run:

git clean -d -f --dry-run

Before you actually execute anything so you can see what it would do. Should it break your CocoaPods master repo, simply delete ~/.cocoapods/repos/master and run pod repo update.

0

You can try it like this. pod spec lint --sources='https://git.oschina.net/yourname/jqcpodspec,https://github.com/CocoaPods/Specs' --allow-warnings --use-libraries

if your spec pass validation, then pod repo push JQCPodSpec FMCommonModelLib.podspec --sources='https://git.oschina.net/yourname/jqcpodspec,https://github.com/CocoaPods/Specs' --allow-warnings --use-libraries

appbanana
  • 21
  • 1
0

I have try 2 day so i give you 100% working method for mac m1 m2

Error: To set up CocoaPods for ARM macOS, run: sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc

amra ram
  • 81
  • 1
  • 2