Ashwani Ashwani - 3 months ago 53
iOS Question

Not able to install cocoa pods on EL Capitan 10.11.1

Getting the following error:

ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)

Please help.

Answer

First you have to update your system (Which will install the ruby gems)

STEPS TO INSTALL COCOAPODS

UPDATE SYSTEM

sudo gem update --system

INSTALL COCOAPODS

Before EL Capitan

sudo gem install cocoapods 

After EL Capitan

sudo gem install -n /usr/local/bin cocoapods

SETUP POD

pod setup

POD INIT (GO TO YOUR PROJECT DIRECTORY)

pod init

OPEN AND UPDATE POD FILE

open -a Xcode Podfile 

INSTALL THE PODs AS PER YOUR NEED

pod install