Update CocoaPods of the Pit Filling Series


We all know that third-party libraries are often used in iOS development. CocoaPods is a tool responsible for managing third-party open source libraries in iOS projects and is widely used.

There are many specific methods of using CocoaPods on the Internet, so I won't repeat them here. When installing third-party libraries using pod install, the following errors may appear:




This problem occurs because after swift3, many frameworks need to be used in cocoapods version 1.1.0 or higher, so we need to update CocoaPods.

1. RVM installation

Terminal input:curl -L get.rvm.io | bash -s stable



If you encounter the above problems, open the [/Users/xxx/.bash_profile](file:///Users/xxx/.bash_profile) file:
terminal input: open .bash_profile

After opening the file, write the sentence "source ~/.profile" and save it.

then install it again

1、curl -L get.rvm.io | bash -s stable
2、source ~/.bashrc
3、source ~/.bash_profile
4、rvm -v

2. List known ruby ​​versions

Terminal input:rvm list known


3. Install ruby ​​2.4.1

Terminal input:rvm install 2.4.1

If the installation fails, as follows:




The solution is as follows, terminal input:

1.brew update
2.brew install gmp

4. Upgrade CocoaPods

Terminal input:
sudo gem install -n /usr/local/bin cocoapods --pre //最新版本
orsudo gem install -n /usr/local/bin cocoapods -v (版本号) //指定安装 cocoapods的版本

Check the version after installation:
terminal input:pod --version


5. Set up the pod repository

Terminal input:
pod repo update --verbose

This process is relatively long and requires patience. After completion, you can use pod install to install the third-party library normally.


Guess you like

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