0

I am trying to install Cocoapods on a mac running MacOS Sierra. After writing "sudo gem install cocoapods" (getting no error), I entered "pod setup". However, my terminal just gets stuck on the line "Setting up CocoaPods master repo".

Can anyone help me identify my mistake? Thanks in advance!

Cliffordwh
  • 1,422
  • 1
  • 10
  • 18
Erica wang
  • 111
  • 1
  • 7

2 Answers2

1

Sometimes it can take long.

You could try running in verbose mode:

pod install --verbose

This'll show you what cocoapods is up to.

pod install or pod setup fetches whole repo with history when you first time run it.

If You don't need that commit history then.

pod setup
Ctrl +C
cd ~/.cocoapods/repos 
git clone --depth 1 https://github.com/CocoaPods/Specs.git master
Cliffordwh
  • 1,422
  • 1
  • 10
  • 18
  • When i type in pod install --verbose, I get an error like this: "[!] No `Podfile' found in the project directory." Any idea why? – Erica wang Jan 17 '17 at 18:13
  • this will help you http://stackoverflow.com/questions/36902497/cannot-install-cocoapods-no-podfile-found-in-the-project-directory – Cliffordwh Jan 17 '17 at 18:18
  • Unfortunately, I still think it is something wrong with my installation of cocoapods itself... After going into a specific folder with an xcode project, I typed "pod install" and this is what it gave me "Setting up CocoaPods master repo". Then it's stuck... Do you know why? – Erica wang Jan 17 '17 at 22:36
  • Also, I tried "pod setup --verbose" and it gets stuck after "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'..."... Should I just wait or am I doing something wrong? – Erica wang Jan 17 '17 at 22:46
0

This is a general problem because how heavy cocoapod is. It's a popular library and have high amount of load to their sever.

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

Muhammad Fauzi Masykur
  • 1,994
  • 1
  • 15
  • 18