1. Open Terminal
2. Remove the existing Ruby default source
$ gem Sources--remove https://rubygems.org/
3. Use the new source
$ gem sources-a https://ruby.taobao.org/
4. Verify that the Xinyuan is replaced successfully
$ gem sources-l
After success appears:
Current SOURCES * *https://ruby.taobao.org/
5. Installing CocoaPods
sudo Install cocoapods$ pod Setup
Note: Apple system upgrade OS X EI Capitan after installation to ( I use the system, so the above command is not verified ):
sudo Install -n/usr/local/bin cocoapods$ pod setup
1) Following the successful execution of the first command, it will appear as follows:
2) After successful execution of the second command, the contents are as follows:
Note: You may need to wait a little longer.
6. Update the GEM
sudo gem update--system
If you enter:
Pod
command, a pod-related help command appears, indicating that the installation was successful!
To view the version number of the command:
Pod--version
Other operations:
1. Create a new Podfile file
Touch Podfile
2. Edit the Podfile file and write to the third-party library you want to add
' 8.0 ' 'afnetworking'~> 2.3.1'<-------third party
3. Installing third-party libraries
Install
PS: More commands to open the terminal, use the pod command to view the help.
Reference:
1. CocoaPods Installation and use
2. Installation process for the latest version of IOS CocoaPods
"IOS" Installation CocoaPods