Pod install is staying on "Setting up CocoaPods Master repo"

122,542

Solution 1

You could try running in verbose mode:

pod install --verbose

That'll show you what cocoa pods are up to:

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'...

(as suggested here)

For me the above step took quite a long time as the repo (Dec 2016) is now 1.1 GB

Solution 2

pod install or pod setup fetches whole repo with history when you first time run it. You don't need that commit history.

pod setup
Ctrl +C
cd ~/.cocoapods/repos 
git clone --depth 1 https://github.com/CocoaPods/Specs.git master

It takes around 2 mins on decent network connection (4Mbps). master directory is around 519M big.

Solution 3

Try this command to track its work.

while true; do
  du -sh ~/.cocoapods/
  sleep 3
done

Solution 4

The issue is that you haven't got command line tools installed, I believe. Try run in terminal:

sudo gem update --system

after that download command line tools from Apple just search for 'Command Line Tools' and download the right version for your OS. Once you install it run in terminal:

sudo gem install cocoapods
pod setup

Solution 5

May be this information will be helpful:

Official answer: http://blog.cocoapods.org/Master-Spec-Repo-Rate-Limiting-Post-Mortem/

As a result of this discussion https://github.com/CocoaPods/CocoaPods/issues/4989

Briefly: CocoaPods repository experiences a huge volume of fetches from GitHub and it was the problem. Changes have been available since version 1.0.0.beta.6.

Tips from this document:

If for whatever reason you cannot upgrade to version 1.0.0 just yet, you can perform the following steps to convert your clone of the Master spec-repo from a shallow to a full clone:

$ cd ~/.cocoapods/repos/master
$ git fetch --unshallow

My hack to first installation:

1. pod setup
2. Ctrl+C
After that I could find ~/.cocoapods/repos/ empty directory 
3. Download  https://github.com/CocoaPods/Specs/archive/master.zip
4. unpack it to ~/.cocoapods/repos/
5. Move to project folder
6. pod install --no-repo-update

Today it takes near 15 minutes

Share:
122,542

Related videos on Youtube

Gabriel Goncalves
Author by

Gabriel Goncalves

sr iOS developer working for Globant at the Walt Disney Company.

Updated on October 22, 2020

Comments

  • Gabriel Goncalves
    Gabriel Goncalves over 3 years

    I'm cloning a project from a git repo, but when I execute pod install the first line I see is "Setting up CocoaPods Master repo" and after that I can't see anything more, the console stops there.

    I don't know what is happening. Anyone knows what's happening here? Why Does CocoaPods stop there?

  • Gabriel Goncalves
    Gabriel Goncalves over 10 years
    Hi, I'm trying to install command line tools from Xcode but it doesn't appear there (I have mavericks) I also follow this steps stackoverflow.com/questions/15371925/… and now I could check that I have command line tools installed, but "Setting up Cocoapods Master repo" is still there when I execute "pod install" or "pod setup"
  • Gabriel Goncalves
    Gabriel Goncalves over 10 years
    Hi, I execute pod setup and the message "Setting up Cocoapods Master repo" is still there. How long could it take? I have the command line tools installed
  • Greg
    Greg over 10 years
    When you click the link from my post in the left-top corner in the search box type: command line tools and you have the version for maverick OS on the top.
  • Keith Smiley
    Keith Smiley over 10 years
    Shouldn't be that long, but I'd give it a few minutes
  • Gabriel Goncalves
    Gabriel Goncalves over 10 years
    Hi, it is still showing "setting up Cocoapods Master repo" and never go forward
  • Gabriel Goncalves
    Gabriel Goncalves over 10 years
    Thanks for your help but that didn't work. I have command line tools installed and the message still appears and doesn't go forward
  • Greg
    Greg over 10 years
    @Gabox Have you call sudo gem install cocoa pods and pod setup after you installed command line tools?
  • Gabriel Goncalves
    Gabriel Goncalves over 10 years
    Yes I have called sudo gem install cocoapods. I solve the problem following this tutorial cocoafactory.com/blog/2013/02/01/… Thanks for your help
  • Gabriel Goncalves
    Gabriel Goncalves over 10 years
    Your answer help me, you can edit your answer and put the previous link I put and I can accept your answer
  • László Papp
    László Papp over 10 years
    Quoting masweb: "check ls -lta ~/.cocoapods/repos/master/.git/objects/pack/ its downloading temporary pack there".
  • user
    user about 10 years
    Got to 50mb before I killed it. api.github.com/repos/cocoapods/cocoapods says the repo is only 42k
  • cduhn
    cduhn almost 10 years
    Tip for my fellow obsessives, building on Final Contest above: run brew install watch then watch ls -lta ~/.cocoapods/repos/master/.git/objects/pack/ to monitor progress.
  • ikzjfr0
    ikzjfr0 over 9 years
    you can use this way to speed up :pod install --verbose --no-repo-update
  • Gabriel Goncalves
    Gabriel Goncalves over 8 years
    that's not actually an error, just a lack of information... you just only need to add --verbose when you run the command to check what is happening
  • maxhawkins
    maxhawkins about 8 years
    alternatively: watch du -sh ~/.cocoapods
  • John Griffiths
    John Griffiths almost 8 years
    Thanks for posting that. In the end my .cocoapods master directory ended up at 746mb. Took about 20 minutes, walk the dog, put the kettle on, or just take a nap :-)
  • Gabriel Goncalves
    Gabriel Goncalves almost 8 years
    nice, thanks for sharing it. but it is weird that --verbose doesn't work for you...
  • Ahsas
    Ahsas almost 8 years
    actually it does print some info in the beginning but then theres a long wait involved when downloading that 300MB+ file... anyway hope it helped!
  • Aman Satija
    Aman Satija over 7 years
    the size has gone upto 482 MB
  • afield
    afield over 7 years
    Much more useful than just --verbose. Time for a cup of tea!
  • Gobe
    Gobe over 7 years
    Awesome, I used this to fix several weird issues I was having on pod update, like fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Just had to rm -rf ~/.cocoapods before executing the suggested commands.
  • Glenn Posadas
    Glenn Posadas over 7 years
    I gotta commend Tina for this. This is the fastest way to solve this problem. I used it, and it's effective! lol. Posted December 1, 2016. :)
  • A-Majeed
    A-Majeed over 7 years
    Just to be clear, when you said to unpack the folder, will it look like this : ~/.cocoapods/repos/spec-master/...
  • Tina Zh
    Tina Zh over 7 years
    no, you should unzip it as ~/.cocoapods/repos/master (just rename) as recommend here github.com/CocoaPods/Specs/releases
  • Zack Shapiro
    Zack Shapiro over 7 years
    This should be the accepted answer. Also one note, with a fresh MBP and Sierra installed, pod repo remove master didn't anything. I skipped to the next step and proceeded and it worked perfectly
  • Vaiden
    Vaiden over 7 years
    Please mind that 'pod update' will still cause a full fetch. 'pod install' won't. Info: blog.cocoapods.org/Master-Spec-Repo-Rate-Limiting-Post-Morte‌​m
  • Alessio Dal Bianco
    Alessio Dal Bianco over 7 years
    Why cocoapods.org not mention this type of install? Stop wasting tons of developers hours!
  • Anirudha Mahale
    Anirudha Mahale over 7 years
    am I suppose to copy the extracted files to ~/.cocoapods/repos/ directory OR am I suppose to copy to my xcode project's root directory?
  • Tina Zh
    Tina Zh over 7 years
    You should unpack files to ~/.cocoapods/repos/master directly. After that: call "pod install --no-repo-update" in project folder
  • Eduard
    Eduard over 7 years
    Sugested an edit for 'pod repo remove master', as it did not work for me, nor some commenters above.
  • August
    August over 7 years
    If you already have done this and run into a "out-of-date" issue, you should: 'cd ~/.cocoapods/repos/master', and then do: 'git pull'
  • Lakshmi Keerthana Siddu
    Lakshmi Keerthana Siddu over 7 years
    while i am doing pod init I got "LoadError - cannot load such file -- nanaimo" Error message. could you suggest any solution ?
  • iPeter
    iPeter about 7 years
    After giving the last command it is showing this: fatal: destination path 'master' already exists and is not an empty directory.
  • lisowski.r
    lisowski.r about 7 years
    @iPeter remove master directory before clone eg rm -rf ~/.cocoapods/repos/master
  • denblackstache
    denblackstache almost 7 years
    Instead of «5. Move to project folder» you could just git init in that place and git remote add origin https://github.com/CocoaPods/Specs.git
  • Jared Chmielecki
    Jared Chmielecki almost 7 years
    300 megs is "fixed" ?? They need to look at NPM for some ideas.
  • AamirR
    AamirR almost 7 years
    @JaredChmielecki as the OP, I had the same issue with old CocoaPods version (during install massage always stays "Setting up CocoaPods Master repo") now we have a download progress so that we understand some download is in progress behind the scenes ;) I know the repo is getting huge, hope we get a fix about this
  • Led
    Led almost 7 years
    confirmed working July 2017. Remember to use --no-repo-update
  • mstrthealias
    mstrthealias over 6 years
    I had to finish with cd PROJ_DIR; pod install --no-repo-update
  • Thom
    Thom over 5 years
    1.4GB as of today LOL
  • Akshay Vijay Jain
    Akshay Vijay Jain over 3 years
    what does this solution help with? please