MacOS 10.15.x latest installation Cocoapods tutorials and problem solving time-tested ------

First, the concept understanding

  First, do not rush to search the terminal command, you need to understand what is required to install cocoapods environment, if you encounter the problem of how to solve it is important to install the way, is very important, very important!

  1, the installation environment pods need to rely on ruby, ruby ​​and installation tools you need to help rvm, rvm is used to manage ruby ​​version, which means you can install multiple versions of ruby ​​on your computer can use to manage their rvm. The installation rvm they need the help of another tool Homebrew, Homebrew is the package management tool under Mac OS platform, with install, uninstall, update, view, search, and many other useful features. Homebrew here does not do too much to explain.

  2, so reading the above, about the installation procedure has been very clear - first install the Homebrew -> install rvm -> install ruby ​​-> final installation cocoapods.

Second, get to the point

  1, install Homebrew

  First open type the following command detecting whether a terminal has been installed the Homebrew:

brew list

  If the terminal has a number of output file name, proved already installed the Homebrew this time you can skip to step 2. If you are prompted brew not Fond such display would need to install the Homebrew.

  Installation Homebrew, terminal enter the following command:

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

  Note here the best go Homebrew official website copy command, because the command may change, the official website address: https://brew.sh , the installation process if you encounter any problems, do not do too much to explain their own Baidu, because your problem online solutions have been overwhelming, and problems encountered are basically because not visit the site at less than or resources.

 

  2, installation Rvm

  If the Homebrew has been successfully installed, then install Rvm, first check whether Rvm been installed, enter the following command:

RVM -v

  If prompted rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io] it proved already installed Rvm can directly proceed to step 3, otherwise you need to install Rvm.

  Installation Rvm, terminal enter the following command:

`curl -L get.rvm.io | bash -s stable`

  Specify the source:

`Source ~ / .rvm / scripts / rvm`

  Check the installation was successful:

RVM - V
 // successful installation 
// RVM 1.29 . . 3 (Latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [HTTPS: // rvm.io]

  

  3, install Ruby

  Ensuring the Rvm installed after using Rvm install Ruby:

List Known RVM            // to see a list of the best ruby version to update to the latest 
RVM install 2.6 . 3         // install version 2.6.3 (or install the latest version to the new times)

  note! Focus here, is likely to be error occurred while executing this step: Error running 'requirements_osx_brew_libs_install autoconf automake libtool pkg-config libyaml readline libksba OpenSSL' , as shown:

  

  Do not panic this time, the above tips probably means the installationautoconf、automake、libtool、。。。、openssl时出现了错误,因为这些依赖文件有的比较大其中最大的大概有300M左右,所以如果你的网络不好下载很容易超时,这里建议电脑连接手机热点下载,亲测可行速度比较快。接下来我们就手动一步一步来安装这些依赖文件。终端依次执行:

brew install autoconf
brew install automake
brew install libtool
brew install libyaml
brew install libxslt
brew install libksba
brew install openssl

  After executing these commands, depending on the case has been downloaded almost, and then perform a  rvm install 2.6.3 , if you have not downloaded the dependencies do not worry, when executed rvm install again the system will automatically detect when 2.6.3 What you are missing depend automatically downloaded. Then you will find the terminal starts automatically run the command line, this time is not very happy, finally succeeded, grinning heart burst, people can not help but reality is always to sell a batch of mom, at the last minute and what a special the error you, ah ah ah ah ah ah. . .

  Error indicator: Error running '-j. 1 __rvm_make

  Do not panic, soldiers to the breakwater to soil cover thing. Then look down, usually this happens is because your xcode command line is a problem, either not installed or the wrong version. Know the problem is solved chant, terminal type:

xcode-select --install

  And then perform  RVM install 2.6.3 , this time with the terminal in the code continues to run, and finally saw a peaceful green (never been like this color as they are now = _ =).

  Finally, saying that we must be tolerant when it installed Ruby, terminal or prompt you to please download resources when the wait, we must be patient, and must not let the computer automatically sleep, can not let the computer automatically sleep, can not let the computer automatically hibernate!

  If you do so much that you find an error or unsuccessful installation is Ruby, it does not matter back to the original starting point (back to the original starting point Sentimental memories you face ...), uninstall RVM, re-install!

  Remember to reopen the closed terminal, enter the following command to uninstall Rvm:

sudo rm -rf .rvm .rvmrc   /etc/rvmrc ;gem uninstall rvm

  After completion of unloading, according to the above procedure again starts from step 2 again.

 

  4, installation Cocoapods

  Next, we must pay attention! note! note!

  If your Mac system before 10.11, enter:

sudo gem install cocoapods

  If your Mac system is after 10.11, enter:

sudo gem install -n /usr/local/bin cocoapods

  This tutorial talking MacOS 10.15.x of course, to choose the system: sudo GEM install -n / usr / local / bin CocoaPods up.

  Wait terminal finish, you do not wait to see if your installation was successful pods we did not, so you quickly enter the pod search AFNetworking, see if it is successful, the result has locked out, being given as follows:

pod search AFNetworking
[!] Unable to find a pod with name, author, summary, or description matching `AFNetworking`

  This is because although you pods are installed successfully, but .cocoapods / repos local library has not, of course, not search, so you need to perform the last step:

git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master

  Wait terminal download is complete, try again  POD Search AFNetworking  , this is not the time for a while grinning, ha ha ha finally succeeded, the heart can not help but sigh, I really special What skr talent.

 

Guess you like

Origin www.cnblogs.com/shisishao/p/12553221.html