Complete steps to install cocoapods on mac

1. Conceptual understanding

First of all, don't rush to search for terminal commands. You need to understand what environment is needed to install cocoapods. This is very important, very important, very important for how to solve problems if you encounter problems during the installation!

1. To install pods, you need to rely on the ruby ​​environment, and to install ruby, you need the tool rvm, which is used to manage the ruby ​​version, that is to say, you can install multiple different versions of ruby ​​on your computer, and you can use rvm to manage them. To install rvm, another tool, Homebrew, is needed. Homebrew is a software package management tool under the Mac OS platform. It has many useful functions such as installation, uninstallation, update, viewing, and searching. I won't explain too much about Homebrew here.

2. So after reading the above, the general installation steps are already very clear - first install Homebrew --> then install rvm --> then install ruby ​​--> finally install cocoapods.

Two, enter the topic

1. Install Homebrew

First open the terminal and enter the following command to check whether Homebrew has been installed:

brew list
  If the terminal outputs some file names, it proves that Homebrew has been installed. At this time, you can directly skip to step 2. If a prompt such as brew not Fond is displayed, you need to install Homebrew.

Install Homebrew, enter the following command in the terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  Note here that it is best to go to the Homebrew official website to copy the command, because the command may change, the official website Address: https://brew.sh, if you encounter any problems during the installation process, Baidu will not explain too much on your own, because there are already overwhelming solutions to the problems you encounter on the Internet, basically the problems you encounter are because Cannot access the website or download resources.

The installation failed according to this method: Mac terminal: brew command not found solution_A Black Blog-CSDN Blog_mac has no brew command

vi /etc/hosts
185.199.108.133 raw.githubusercontent.com

Please add a picture description
Please add a picture description
Please add a picture description

Guess you like

Origin blog.csdn.net/wangyuhong2267/article/details/129638062