Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pod install takes too long time

I'm trying to install my pods with pod install, it prints

Setting up CocoaPods master repo

and it takes too long time and nothing installing. Is that a bug or that's my mistake? Can I fix that problem?

like image 685
J. Doe Avatar asked Dec 26 '16 09:12

J. Doe


People also ask

How long does pod installation take?

This little change saved me more than 10 minutes. Executing "pod install" now takes less than 2 minutes, while before making this changes it took about 12 minutes.

How do I clear a pod installation?

Just rm -rf that pod's folder, and remove the line from the Podfile. Then run pod install again.

What is the use of pod install?

This is to be used the first time you want to retrieve the pods for the project, but also every time you edit your Podfile to add, update or remove a pod. Every time the pod install command is run — and downloads and install new pods — it writes the version it has installed, for each pods, in the Podfile. lock file.

What is the difference between POD install and pod update?

The difference between pod install and pod update lies in how they interact with the Podfile. lock file. This file is used to store the exact version of each pod that is currently installed in your project.


2 Answers

Yes these problems often occur in first time installation.

So these are what I did to solve it:

1. pod setup

It will do "setting up master" again, DONT' WAIT, continue these steps below

2. Ctrl +C
3. pod repo remove master
4. cd ~/.cocoapods/repos 
5. git clone --depth 1 https://github.com/CocoaPods/Specs.git master

It takes around 5 minutes for me (I think it depends on internet connection), then I can do "pod install".

https://stackoverflow.com/a/40541430/3258003

like image 156
Muhammad Fauzi Masykur Avatar answered Oct 02 '22 15:10

Muhammad Fauzi Masykur


Expanding my comment.

CocoaPods is so popular and heavy, so GitHub is limiting rate for downloading.

From user mhagger, an engineer on GitHub’s infrastructure team:

The slow fetches and clones (which sometimes time out) that the CocoaPods community is experiencing are caused by automatic rate limiting on our servers, which is done to make sure that extremely high levels of load in one repository cannot impact other GitHub users. The CocoaPods/Specs repository is more or less permanently being rate limited.

There have been approximately 1.1 Million clones/fetches from CocoaPods/Specs in the past week. This activity has kept, on average, more than 5 server CPUs permanently pegged, and used several terabytes of bandwidth out of our datacenters. There are only a handful of other repositories in all of GitHub that even come close to this level of activity. As far as I know, this level of activity is not new, but has been going on for many months and probably longer. Suffice it to say that the name CocoaPods/Specs is quite well known within our team.

http://thenextweb.com/dd/2016/03/08/cocoapods-popular-basically-took-five-github-servers/

like image 23
user28434'mstep Avatar answered Oct 02 '22 15:10

user28434'mstep