Update
Pod install error [!] Oh no, an error occurred.
Cocoapods needs to be updated, which mainly involves two points.
1. Ruby Update (v2.5.3)
The command line is often used to update Ruby, But ruby-V is still in the old version.
Because of the new MAC system, Mac generally comes with 2.0
1. $ brew install Ruby
If the installation is successful,/usr/local/cellar/Ruby/2.5.3 will have this file.
When running $ ruby-V, it was still in the old version.
Because of the new MAC system, Mac generally comes with 2.0
2. Modify Ruby Environment Variables
Modify the following three files:
$ Vim ~ /. Profile
$ Vim ~ /. Bashrc
$ Vim ~ /. Bash_profile
Modify the environment variables and add the following to the three files:
Export Path =/usr/local/cellar/Ruby/2.5.3/bin: $ path
Save to take effect:
$ Source ~ /. Profile
$ Source ~ /. Bash_profile
$ Source ~ /. Bashrc
Execute $ ruby-V
Ruby 2.5.3p105 (Revision 65156) [x86_64-darwin17]
2. Update cocoapods (v1.6.0.beta. 2)
There should be a lot of tutorials on the Internet, but some are still very early and some are no longer available.
$ Gem sources -- remove https:// Rubygems.org/
$ Gem sources -- add https:// Gems.ruby-china.com/
$ Gem sources-l
I understand this.
Start cocoapods Installation
$ Sudo gem install-N/usr/local/bin cocoapods
(This is different from the previous commands)
Select the latest xcode version
$ Sudo xcode-select-switch/applications/xcode. APP/contents/Developer
Install local library
$ Pod setup
A long wait... don't remember the specific time. It may take about 3 or 4 hours.
Update when prompted: $ sudo gem install cocoapods -- pre
$ Pod -- version
1.6.0.beta.2
PS: delete cocoapods
$ Sudo gem uninstall cocoapods
View locally installed cocoapods related items
$ Gem list -- local | grep cocoapods
Cocoapods-deintegrate (1.0.1)
Cocoapods-downloader (1.1.3)
Cocoapods-plugins (1.0.0)
Cocoapods-search (1.0.0)
Cocoapods-Stats (1.0.0)
Cocoapods-trunk (1.3.0)
Cocoapods-Try (1.1.0)
Delete one by one
$ Sudo gem uninstall cocoapods-core
$ Sudo gem uninstall cocoapods-deintegrate
...
Digress: The book is quite good. It was originally intended to be a simplified book. It's okay to bind a mobile phone number and bind it to the result (also known as the cyber security law, I don't know where to do it! Decisive abandon!
Cocoapods installation update