preface

Install cocoaPods. This process usually takes a whole day. I will not describe the specific process, but I will only record a few key problems and solutions to help those in need.

The main body

Problem a

Problem of content

On the latest MAC system, use

curl -L get.rvm.io | bash -s stable
Copy the code

RVM installation will be reported at this time

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    188      0  0:00:01  0:00:01 --:--:--   188
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
Copy the code

The details are not very clear, but it is known that the latest MAC operating system does not allow private scripts to be executed, so the execution fails. It’s available online, use

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Copy the code

HomeBrew is now installed and the command is not available

The solution

First of all, the following homeBrew installation command, using the domestic source to install can solve this problem, use the following command, I use tsinghua source to solve the problem, recommend

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
Copy the code

If you encounter a failure in the middle, you can change the network and start again, usually there is no problem. Next comes the key RVM, using

curl -L https://get.rvm.io | bash -s stable
Copy the code

Although the original and the difference between the front https://, but the problem can be solved, after a long wait will be able to solve, if the error, restart or change the network, basically can be solved. However, after the installation is complete, the RVM command still cannot be used properly, because of the installation instructions of an insignificant line, if you need to use it, please execute

source /Users/apple/.rvm/scripts/rvm
Copy the code

After that, you can use RVM commands normally

Question 2

Problem of content

Once the problem is solved, you usually need to install Ruby (RVM was originally installed for Ruby, otherwise who would have done it), but

rvm list known
Copy the code

And then what comes out is a bunch of lists, 20211104

/# MRI Rubies [ruby-]1.8.6[-p420] [Ruby -]1.8.7[-head] # Security released on head [Ruby -]1.9.1[-p431] [ruby -] 1.9.2 [p330 -] [ruby -] 1.9.3 [- p551] [ruby -] 2.0.0 [- p648] [ruby -] 2.1. [10] [ruby -] 2.2. [10] [ruby -] 2.3 [8] 2.4. [10] [ruby -] [ruby -] 2.5. [8] [ruby -] 2.6 [6] [ruby -] 2.7 [2] [ruby -] 3 [0.0] ruby - head / # for forks use: RVM install ruby - head - < name > - url https://github.com/github/ruby.git - 2.2 branchCopy the code

It’s kind of confusing

To solve the problem

rvm install 3
Copy the code

The preceding information cannot solve the problem. You need to enter all version numbers

RVM install 3.0.0Copy the code

When finished, replace the source and execute

sudo gem install cocoapods
Copy the code

There are no problems. Now cocoapods is installed

Question 3

But after pod install, the long wait failed. Because of well-known reasons, we often fail when POD install, the speed can not come, if you encounter these two points or your computer reported

[!]  Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`. You can try adding it manually in `/Users/apple/.cocoapods/repos` or via `pod repo add`.Copy the code

Then carry out the following two steps to solve the problem:

cd ~/.cocoapods/repos
git clone https://github.com/CocoaPods/Specs.git master
Copy the code

After the process is complete, normal pod install is required

Afterword.

Issues with Cocoapods will continue to be updated if they are encountered.