133
MacBook-Pro:~ skbc$ pod setup --verbose
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

Setting up CocoaPods master repo

Cloning spec repo `master` from `https://github.com/CocoaPods/Specs.git` (branch `master`)
  $ /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master
  Cloning into 'master'...

Have gone through resources provided by Cocoapods website, SO and few video tutorials. Nothing happening even after waiting for a couple of hours, however still trying to figure out what may be the problem is?

I would very much appreciate your comments and suggestions.

Lahiru Jayaratne
  • 1,684
  • 4
  • 31
  • 35
sanjay
  • 2,116
  • 3
  • 19
  • 25
  • When I got this it was due to proxy authentication failure. Try connecting via another network if possible. – GuybrushThreepwood Feb 10 '14 at 16:14
  • @CGRasterMouse:thanks for the suggestion,i am not getting your point please tell me little bit more..i am struggling for last 3 day!! – sanjay Feb 10 '14 at 16:18
  • Cocoapods initialization took about an hour for me. In spite of `--verbose`, cloning step went silently. So I checked the size of `~/.cocoapods` directory to ensure it was still cloning. The size has increased to ~100Mb in the end. – vokilam Feb 13 '14 at 10:53
  • 3
    @sanjay: what happens if you just do a `git clone https://github.com/CocoaPods/Specs.git`? Does that work or does it also fail? – Nicholas Smith Feb 13 '14 at 11:13
  • @NicholasSmith: didn't tried..!!i just focused on the direction/steps provided by Cocoapods on there website. – sanjay Feb 13 '14 at 12:27
  • @vokilam: waited for nearly 3-4 hrs and my internet bandwidth is 512 kbps. – sanjay Feb 13 '14 at 12:33
  • @sanjay is the size of the folder changing? try Nicholas Smith suggestion – vokilam Feb 13 '14 at 13:09
  • @vokilam:a repo folder was created, however there was not a single file or folder present inside repo.. – sanjay Feb 13 '14 at 13:47
  • @vokilam:should i try this command suggested by @ Nicholas Smith on terminal directly..? – sanjay Feb 13 '14 at 13:49
  • yes directly, you'll see progress message: `Receiving objects: 15% (19192/125876), 3.65 MiB | 17.00 KiB/s` – vokilam Feb 13 '14 at 14:09
  • In another Terminal window, run `ls -ltah ~/.cocoapods/repos/master/.git/objects/pack/` and then run it again after another 30 seconds or so -- assuming things are still chugging along, you should see a `tmp_pack_` file that is slowly increasing in size each time. – smileyborg Feb 15 '14 at 23:24
  • @sanjay could you please accept my answer as a valid one? it would be very nice! Thanks – Manuel M. Aug 04 '15 at 15:27
  • [http://stackoverflow.com/questions/23755974/cocoapods-pod-install-takes-forever/38675146#38675146](http://stackoverflow.com/questions/23755974/cocoapods-pod-install-takes-forever/38675146#38675146) – Harshal Wani Jul 30 '16 at 14:52

13 Answers13

416

It is not stuck. I thought the same until I went to the "Activity Monitor" of the system and checked the "Network" tab.

Then you will see that something is being downloaded. A process called git-remote-http is in charge of this.

Screenshot 1

Just wait! It happened the same for me :)

starball
  • 20,030
  • 7
  • 43
  • 238
Manuel M.
  • 4,445
  • 1
  • 15
  • 15
58

To get a progression, you can clone master yourself:

pod repo remove master
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
pod setup
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • 9
    I use command below to boost up the cloning time: `git clone --depth=1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master` – An Nguyen Dec 27 '15 at 11:23
  • 2
    @AnNguyen CocoaPods 1.0.0 will not be officially supporting shallow clones anymore. It will even attempt to `--unshallow`: https://github.com/CocoaPods/CocoaPods/issues/5016 – Cœur Mar 10 '16 at 00:40
  • One whole date past and I found this solution. I my case I have to retype 'git clone' three times to download it correctly. – Vyacheslav May 22 '16 at 06:50
  • 4
    Thanks for the solution! At least it shows that something happening. ;) – Vladimir Obrizan Dec 25 '19 at 13:30
48

This might be due to the http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ issue... You will have to remove the repo and re-setup it...

pod repo remove master
pod setup

worked for me

Answered in below question as well, Error on pod install

Community
  • 1
  • 1
shehanrg
  • 586
  • 5
  • 14
  • 1
    Do I need to do this or I should wait as suggested in the answer by @Manuel M. ? – Pavan Kotesh Sep 23 '14 at 13:51
  • 11
    Ha ha, even removing spec repo 'master' takes forever here... :/ –  Sep 26 '14 at 07:04
  • In both cases *pod install* or, *pod setup* it updates local repository. We don't have choice wait as suggested by @Maunel M, it works after sometime. – iphonic Sep 22 '15 at 08:52
12

I think you need to follow the steps to get rid of the situation and also add --verbose to check whats is happening in front of each command eg:

$ pod setup --verbose
  • pod repo remove master
  • pod setup
  • pod install
Opal
  • 81,889
  • 28
  • 189
  • 210
Musadaq Rasees
  • 131
  • 1
  • 3
10

This is not Stuck or not doing anything its downloading/cloning repository (total size is around 360MB, I am not sure)

1) Open Activity Monitor

2) Select Network Tab

3) Check bellow Google chrome -> git-remote-https

enter image description here

Sachin Nikumbh
  • 911
  • 11
  • 11
  • Downvoted as you gave the same answer that was selected as the correct answer 2 years before your posting. – Stu P. Aug 19 '22 at 23:13
5

For insecure people like me who needs an assurance that cocoapods, in fact, is doing the work, try this. The slowest bottleneck is when cocoapods try to clone the entire repo (~300 MB) into ~/.cocoapods

while true; do
  du -sh ~/.cocoapods/
  sleep 3
done
Daniel Shin
  • 5,086
  • 2
  • 30
  • 53
5

For me in China

I have to use SSH and --depth=1 to boost up!

pod repo remove master
git clone --depth=1 git@github.com:CocoaPods/Specs.git  ~/.cocoapods/repos/master 
pod setup
Cœur
  • 37,241
  • 25
  • 195
  • 267
PeiweiChen
  • 413
  • 5
  • 16
  • 1
    CocoaPods 1.0.0 will not be officially supporting shallow clones anymore. It will even attempt to `--unshallow`: https://github.com/CocoaPods/CocoaPods/issues/5016 – Cœur Mar 10 '16 at 00:40
  • Github and CocoaPods are discouraging `--unshallow`: https://github.com/CocoaPods/CocoaPods/issues/5007#issuecomment-194309832 – Cœur Mar 10 '16 at 00:49
  • 1
    Permission denied (publickey). fatal: Could not read from remote repository. – J.J. May 08 '16 at 01:38
  • @JordanJohnson try my answer if you haven't setup SSH keys for github. – Cœur May 13 '16 at 15:35
5

The time required for Pod setup depends on your Internet connection speed. You can check Activity Monitor application regarding this.

Screenshot 1

It is recommended to use pod setup --verbose command instead of pod setup.

This verbose helps you to see detailed stats while pod is being setup.

Screenshot 2

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
5

I had the same problem with pod install and pod update.

The problem is that after executing any of these two commands. A process called git-remote-http in monitor activity shows that something is being downloaded. This has been an existing issue with pods and an issue has opened on github. I've tried a lot of the recommended solutions. I was finally able to install the firebase cocoapod on my project.

Go to

~/.cocoapods/repos

if there is a master file here, you will need to delete it.

You can do something like

sudo rm -R -i yourmasterdirectory 

do pwd ... you should still be in ~/.cocoapods/repos

if the above did not work try

pod repo remove master

Once you have done this run

git clone https://github.com/CocoaPods/Specs.git master

the next thing you need to do is to is run git fetch --depth=2147483647 - this will convert your local repository of Podspecs to be a full clone as noted here:

pod install and pod update should work fast as expected.

TheRealRonDez
  • 2,807
  • 2
  • 30
  • 40
2

To execute it, you must pay attention in your Internet connection... if it fails for a sec, the command won't continue, but terminal won't tell you what's happening. If the command fails, continue trying... worked for me! I've used that command!

$ git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master

Joehl
  • 3,671
  • 3
  • 25
  • 53
2

--VMWare Workstation--virtualizedMac--NetworkSetting--Problem

After like 100 tries I got it to work! I have tried nearly everything described here but nothing solved the problem. It randomly stopped by cloning into master between 0% and 97%. In Activity Monitor I saw the network traffic has stopped.

Finally I have changed the network setting from NAT to BRIDGE. This was the solution!

NoWay
  • 21
  • 3
  • Thank you, you saved me on this issue. MacOS VMWare, had same problem switched to bridge after doing control panel -> repair VMWare then repatching my VMWare for MacOS fixed bridge mode. After fixing bridge mode, and rerunning the setup it went smoothly. – Ginzo Milani Aug 23 '18 at 21:36
0

Just setup the master repo, was excited to see that we have a download progress, see screenshot ;)

CocoaPods release 1.2.0 (Jan 28) fixes this issue, thanks to all contributors and Danielle Tomlinson for this release.


enter image description here

AamirR
  • 11,672
  • 4
  • 59
  • 73
0

Might not be directly related to your issue, but for me I already had the repo cloned but an old library that I attempted to use was pointed at a different spec repo and I didn't actually need to clone this spec repo. To bypass cloning another spec repo I just went into the library's Podfile and removed source line. It instantly installed the pods, didn't have to clone another spec repo.

nodebase
  • 2,510
  • 6
  • 31
  • 46