Cocoapods installation in two steps: The first step, modify the native Ruby environment; second step, install.
The first step: Step 1, open the terminal input gem sources-l view native ruby environment, if "https://ruby.taobao.org/" is displayed, the ruby environment is available, skip the first step and proceed to install the second step.
Step 2, if "https://rubygems.org/" is displayed, perform step 3.
Step 3, in the terminal execute Gem sources-remove+ space + Step 2 to remove the current image, the terminal command is the gem Sources-remove https://rubygems.org/
Step 4, after successful removal, execute gem sources-a https://ruby.taobao.org/modify Mirror
Step 5, re-execute step 1 to see if the current ruby environment is https://ruby.taobao.org/, if so, the first step is completed, perform the second step installation
Step Two: Step 11, execute the terminal command: sudo gem install cocoa pods, click Enter to confirm that you want to enter the local password, where the password is not displayed, enter the password directly to confirm
Step 22, execute Terminal command: Pod Setup NOTE: This step is a bit slow, wait patiently, the following error occurred, indicating that the network connection is not normal, re-pod setup
If the following prompt appears, the installation is complete:
To view the installation progress reopen a terminal (commond+n), first enter CocoaPods (CD ~/.cocoapods) and enter (DU-SH *)
Use of Cocoapods:
Step 1, first of all, there must be a target project, that is, to use a third party in that project.
Step 2, open the Terminal execution command: Pod search + third-party library name for example: Pod search Mbprogresshud return results,
Copy the contents of the red line indicating part of the backup, if the terminal appears at the bottom of the "end", enter Q to
Step 3, execute the terminal command: CD + Target project path (the target project's path can drag the target project to the terminal), enter OK, enter into the target project path
Step 4, execute the terminal command: Vim podfile into the interface, my project has added a third party, may look different
After entering this side, click I enter the interface (the bottom of the interface is different)
Step 5, enter the part: The second line of "Uisenior_18_cocoapods" is the project name of your target project; "Pod ' sdwebimage ', ' ~> 3.7.6 '" is the content of your pasted backup.
Platform:ios, ' 8.0 '
Target "Uisenior_18_cocoapods" do
Pod ' sdwebimage ', ' ~> 3.7.6 '
End
Enter Finish Press "ESC" and enter: Wq Click OK (Note: To enter in the English state)
Step 6, execute the terminal command Pod update is available
Cocoapods Installation and use