1, first open the terminal check under Ruby version Note: Apple is self-containing ruby
Ruby-v View Ruby version
luweiminidemini:~ luweimac_mini$ Ruby-v
Ruby 2.3.3p222 (2016-11-21 revision 56859) [UNIVERSAL.X86_64-DARWIN17]
If you need to update Ruby
Update Ruby
Terminal Enter the following command (point the Ruby image to Taobao, avoid being the wall, you know)
Gem Sources--remove https://rubygems.org/
Gem Sources-a https://ruby.taobao.org/
Gem sources-l (used to check for successful use of alternate mirror locations)
2, download install Cocoapods If there is no need for the following actions
sudo gem install cocoa pods
I see the gem installed is ready to install.
3, how to use Cocoapods to manage the third party?
Before we develop a project, we need to create a new development project. This step does not require cocoapods.
In the terminal input
CD (Drag the new item into this)
luweiminidemini:~ luweimac_mini$ CD /users/luweimac_mini/desktop/podtest project's root directory
Vim Podfile Create a new configuration file
Format must be as follows this is a high version
Platform:ios, ' 8.0 '
Target ' podtest ' do
Pod ' third party '
End
Then Esc:wq quit.
Pod Install
Pod Update update pod file
Pod Repo update
Select the pod ' third party ' you want to delete
Re-execute the pod install--verbose--no-repo-update command from the terminal CD to the root of the current project
IOS cocoapod hands-on steps