1. Install

If you have installed it before, you can proceed to step 3: Uninstall.

A. Run the gem sources –remove https://rubygems.org/ command to delete the inherent Ruby image.

B. Enter gem Sources -a https://gems.ruby-china.org/ to add an image from Taobao

C. Run gem sources -l to check whether the image is successfully replaced

D. Update Ruby. Enter sudo gem update –system.

E. Run sudo gem install -n /usr/local/bin CocoaPods to install CocoaPods.

F. Run the pod –version command to check whether CocoaPods is successfully installed.

G. Install CocoaPods and enter POD Setup.

2. Use

A. CD to the project ——- CD XXX

B. Automatically generate podfile —– pod init

C. search framework —- pod search XXX (e.g. navigation)

D. add framework – vi podfile — — — – > click on the I — — — — — – > copy framework (such as pod ‘Masonry’, ‘~ > 1.1.0) — — — – > click esc — — — — > : wq!

E. Install the framework —— pod install(Update the latest framework using update)

3. The unloading

A. Uninstall cocopods if you have installed cocopods before.

$ sudo gem uninstall cocoapods

B. Run the following command to view cocopods installed locally:

$ gem list –local | grep cocoapods

The following is displayed:

Cocoapods – core (0.39.0)

Cocoapods – downloader (0.9.3)

Cocoapods – plugins (0.4.2)

Cocoapods – search (0.1.0 from)

Cocoapods – stats (0.6.2)

Cocoapods – trunk (0.6.4)

Cocoapods – try (0.5.1)

Then delete one by one:

$ sudo gem uninstall cocoapods-core

.

C. First display the Mac hide folder. Run the following commands to hide and display Mac files:

Hidden: Defaults Write com.apple.finder AppleShowAllFiles -bool true

Display: Defaults Write com.apple.finder AppleShowAllFiles -bool false

D. Exit the terminal and restart Finder

E. If in doubt, delete all the hidden files in the home directory and reinstall Ruby and Cocopods.