Cocoapods Installation
Gem Source view gem sources
If there is no https://ruby.taobao.org/, delete the same source and add the https://ruby.taobao.org/Source:
Gem Source--remove existing source (copy and paste, do not fall behind the slash)
Gem Source--add https://ruby.taobao.org/
If successful, the Gem source--add command will prompt "added source ..."
If you want to verify further, you can use gem source again to view
After the gem source has been replaced successfully, install Cocoapods
sudo gem install cocoapods--verbose
Parameter explanation:
Sudo:super do, use System super admin to do one thing
Gem install using the Gem tool for installing a tool
--verbose verbose mode, the installation length if long, will stop in the "terminal" window, and no response, will think that died there. Verbose meaning "wordy", no matter what progress will tell you
After this command is finished, the screen will scroll
Cocoapods use
1 first need to have a project
In the terminal, enter the directory where the project files are located
CD mouse Drag the directory to the terminal
2 Creating a configuration file
Pod init copy and paste the full name of the project file to the terminal
3 Modifying a configuration file
Delete "Platform:ios, ' 9.0 '" before the well number
In the target block, add the name of the third-party library you want to use
Pod ' afnetworking '
Pod ' Sdwebimage '
4 Let Cocoapods configure third-party libraries and projects based on configuration files
Enter terminal
Pod Install--verbose--no-repo-update
Parameter interpretation
--verbose
Verbose mode
--no-repo-update
The repository is not updated until you install
Cocoapods Installation and use