The latest installation method of cocoapods

Replace the source (because Ruby's software source rubygems.org is blocked, the invisible wall in China, we need to modify and replace the source, switch the source to ruby-china; most of the online use https://ruby.taobao. org, it is no longer recommended to use here, this is because the taobao Gems source has stopped maintenance, and is now provided by ruby-china to provide mirror services)
Execute the command:
gem sources --remove https://rubygems.org/
gem sources -- a https://gems.ruby-china.org/

Next, to check whether the source path is successfully replaced, execute the command:
gem sources -l

To update Ruby, execute the following command:
sudo gem update --system

Start installing Cocoapods, execute the command:
sudo gem install cocoapods
may report an error

Execute the command sudo gem install -n /usr/local/bin cocoapods

After a successful pod setup

, after a long wait, you can use Pods happily.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324485583&siteId=291194637