As mentioned in other answers, It takes forever because the size of cocoapods master repo is huge. This time can be reduced using the following steps. 1) Create a private specs file path on your github repository. Provide this path https://github.com/yourpathForspecs.git' as a source in your podfile.
You added a new pod to your Podfile This will install the latest version* of any new pods added to your Podfile, leaving your other pods unchanged. If you were to run pod update instead, it would install the new pods and update each of your existing pods to its latest version*.
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
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.
Try this command to track its work.
while true; do
du -sh ~/.cocoapods/
sleep 3
done
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With