1. Installation and upgrade
$ Sudo gem install cocoapods
$ Pod setup
2. Change to the taobao source.
$ Gem sources-r https://rubygems.org/
// Run the following command after the response.
$ Gem sources-a http://ruby.taobao.org/
// View
$ Gem sources-l
3. gem upgrade
Gem is a standard package for managing Ruby libraries and programs. If its version is too low, the installation may fail. The solution is to upgrade gem.
$ Sudo gem update -- system
4. Edit Podfile
Platform: ios
Pod 'reachability ',' ~> 3.0.0'
Pod 'sbjson', '~> 4.0.0'
Platform: ios, '7. 0'
Pod 'afnetworking', '~> 2.0'
5. Import a third-party library
Pod install
Due to speed issues, I don't know how much time is wasted!
The most used pod install and pod update must upgrade the cocoapods spec repository each time. You can skip this step by adding parameters during command execution. The details are as follows:
Pod install -- verbose -- no-repo-update
Pod update -- verbose -- no-repo-update