Cocoapods mirror update Tencent (updated version)

Cocoapods mirror update Tencent (updated version)

...omitting some gem sources switching steps...

(注:淘宝的ruby镜像已停止更新,最新的镜像应切换到ruby-China)

But the pit is coming, the first problem encountered is:

//When I execute this step, I get the wrong return information

$ sudo gem install cocoa pods

Error installing cocoapods:activesupport requires Ruby version

>= 2.2.2.

//So I planned to update the gem, and the returned information was that the update to the latest version was rejected, and the version still stayed at 2.0.0

$ sudo gem update --system

Latest version currently installed. Aborting.

//目前ruby的版本信息为2.0.0

$ ruby

ruby 2.0.0

//So I plan to reinstall ruby ​​on mac. The first method I try is to install it with the simplest Homebrew command line

//If Homebrew is not installed, please enter this command to install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

//Then use the brew command line to install ruby

$ brew install ruby

//After the bingo installation is successful, the ruby ​​version is displayed as 2.3.1, which is perfect. But do you think this is the end?

$ ruby -v ``ruby 2.3.1

// When I was switching to a new ruby ​​image, I had a lot of questions about openssl. . . It is found that there are only openssl executable files without corresponding directories

$ gem sources -a https://gems.ruby-china.org

Unable to require openssl, install OpenSSL and rebuild ruby

(preferred) or use non-HTTPS sources

The real hole-filling is here. (6 steps to fill the hole)

1、下载ruby最新源码 点此下载 并解压 .

2、首先用命令安装openssl $ brew install openssl

If it prompts openssl-1.0.2h_1 already installed, it means that openssl has been installed

3、cd源码文件 $ cd ruby-2.3.1

4. Configure the source code (the openssl directory index needs to be added here)

$ ./configure --with-openssl-dir=/usr/local/ssl

5. Compile ruby ​​source code $ make

6、最后安装ruby $ sudo make install

Finally, I’m done and I’ll talk about why I went to the official website to download the source code compression package. Because I’m too lazy to go to the local file to find the installation location of ruby, so it’s faster to download and CD directly, and in this case, I can understand the entire ruby ​​installation process more intuitively. In the past, Macs directly integrated the ruby ​​environment, and it can be used directly by updating.

Guess you like

Origin blog.csdn.net/hpyhn0204/article/details/130429688