(菜鸟向) CocoaPods 奇遇记

2,254 阅读4分钟

前言

本文并 不是完整的 cocoapods安装过程, 而是对部分 报错信息 的分析. 目前我也是一知半解, 可能无法为您提供正确有效的解决方法.

做iOS有几年的时间了, cocoapods 自然是电脑必装的开发组件之一. 每次换电脑都需要重新走一遍安装流程, 粗略算一下, 至少安装过5次. 虽然每次都不太顺利, 有各种各样的警告和报错, 但在搜索引擎的帮助下都能安装完成, 然后进入后续开发流程. 但是这次很特殊, 折腾的让我怀疑人生.

开发环境

  • OS: macOS Catalina 10.15.7

  • Xcode: 12.4 (12D4e)

  • CocoaPods

    • podfile.lock: 1.9.1 (项目要求pod的最低版本)
    • 当前已安装的pod: 1.5.2
    • 目的: 需要升级本地的pod版本, 至少是 1.9.1 才可以
  • 查看 pod 版本

alex@Alexs-MacBook ~ % pod --version

1.5.2

Terminal报错信息合集

1. 不能构建gem原生扩展

ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.
  • 完整 Log 如下 👇

alex@Alexs-MacBook ~ % sudo gem install cocoapods

Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
       ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20210817-2819-qsl0gd.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-ffi_c-dir
	--without-ffi_c-dir
	--with-ffi_c-include
	--without-ffi_c-include=${ffi_c-dir}/include
	--with-ffi_c-lib
	--without-ffi_c-lib=${ffi_c-dir}/lib
	--enable-system-libffi
	--disable-system-libffi
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
	from extconf.rb:10:in `system_libffi_usable?'
	from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.15.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.15.3/gem_make.out
  • 解决思路
    • 这个error的信息超多, 没有搞懂到底怎么解决
    • 有的人讲升级 ruby 版本
  1. 获取当前ruby版本

alex@Alexs-MacBook ~ % ruby --version

ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
  1. 获取可升级的ruby版本

alex@Alexs-MacBook ~ % rvm list known

# 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]
[ruby-]2.4[.10]
[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 --branch 2.2

# JRuby
jruby-1.6[.8]
jruby-1.7[.27]
jruby-9.1[.17.0]
jruby[-9.2.14.0]
jruby-head

# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx-3[.107]
rbx-4[.20]
rbx-5[.0]
rbx-head

# TruffleRuby
truffleruby[-20.3.0]

# Opal
opal

# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1.2.0
mruby-1.3.0
mruby-1[.4.1]
mruby-2.0.1
mruby-2[.1.1]
mruby[-head]

# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]

# Topaz
topaz

# MagLev
maglev-1.0.0
maglev-1.1[RC1]
maglev[-1.2Alpha4]
maglev-head

# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head

# IronRuby
ironruby[-1.1.3]
ironruby-head
  1. 选择最新的 3.0.0, 直接安装

alex@Alexs-MacBook ~ % rvm install 3.0.0

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-3.0.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
Checking requirements for osx.
Installing requirements for osx.
Updating system - please wait
Failed to update Homebrew, follow instructions at

    https://docs.brew.sh/Common-Issues

and make sure `brew update` works before continuing.
Error running 'requirements_osx_brew_update_system ruby-3.0.0',
please read /Users/alex/.rvm/log/1629166300_ruby-3.0.0/update_system.log
Requirements installation failed with status: 1.
  • 如上文安装失败, 报错信息为
Error running 'requirements_osx_brew_update_system ruby-3.0.0'
  • 根据提示, 执行命令

alex@Alexs-MacBook ~ % brew update

fatal: Could not resolve HEAD to a revision
Updated 1 tap (homebrew/cask).
==> New Casks
foxglove-studio
==> Updated Casks
ableton-live-intro
brake
ableton-live-lite
r
ableton-live-standard
quest
ableton-live-suite
shark
angband
arq
drive
audius
ra
avogadro
badlion-client

...
...
...
还有一些无关紧要的信息, 但MD格式排版不合适, 所以不贴上来了
  • 如上文 homebrew update 有问题, 不知如何解决
  • 再次尝试, 仍然报错, 报错内容相同
No binary rubies available for: osx/10.15/x86_64/ruby-3.0.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
  • 尝试安装 2.7.2 低版本, 报错内容基本相同
No binary rubies available for: osx/10.15/x86_64/ruby-2.7.2.\
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
  • 至此已经懵逼, 无法进行下去

2. 继续探索 ruby

  • 搜索到神秘代码

alex@Alexs-MacBook ~ % rvm autolibs read-only alex@Alexs-MacBook ~ % rvm install 3.0.0

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-3.0.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Missing required packages: autoconf automake libtool pkg-config coreutils libyaml libksba readline zlib openssl@1.1 
Somehow it happened there is no executable 'openssl',
run 'brew doctor' and make sure latest 'openssl@1.1' is installed properly.
Requirements installation successful.

Installing Ruby from source to: /Users/alex/.rvm/rubies/ruby-3.0.0, this may take a while depending on your cpu(s)...
ruby-3.0.0 - #downloading ruby-3.0.0, this may take a while depending on your connection...

% Total % Received % Xferd Average Speed Time Time Time Current 
Dload Upload Total Spent Left Speed 
100 18.6M 100 18.6M 0 0 3854k 0 0:00:04 0:00:04 --:--:-- 4077k

ruby-3.0.0 - #extracting ruby-3.0.0 to /Users/alex/.rvm/src/ruby-3.0.0 - please wait ruby-3.0.0 - #configuring - please wait
ruby-3.0.0 - #post-configuration - please wait
ruby-3.0.0 - #compiling - please wait
ruby-3.0.0 - #installing - please wait
ruby-3.0.0 - #making binaries executable - please wait
Installed rubygems 3.2.3 is newer than 3.0.9 provided with installed ruby, skipping installation, use --force to force installation.
ruby-3.0.0 - #gemset created /Users/alex/.rvm/gems/ruby-3.0.0@global
ruby-3.0.0 - #importing gemset /Users/alex/.rvm/gemsets/global.gems - please wait
Error running 'command gem install rubygems-bundler --no-document',
please read /Users/alex/.rvm/log/1629167873_ruby-3.0.0/gem.install.rubygems-bundler.log
there was an error installing gem rubygems-bundler
ruby-3.0.0 - #generating global wrappers - please wait
ruby-3.0.0 - #gemset created /Users/alex/.rvm/gems/ruby-3.0.0
ruby-3.0.0 - #importing gemsetfile /Users/alex/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-3.0.0 - #generating default wrappers - please wait
ruby-3.0.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-3.0.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
  • 貌似安装成功了, 再次查看版本

alex@Alexs-MacBook ~ % ruby -v

ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]\
  • 查看 rvm 版本

alex@Alexs-MacBook ~ % rvm -v

rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
  • 查看 brew 版本

alex@Alexs-MacBook ~ % brew -v

Homebrew 3.2.7
Homebrew/homebrew-core (no Git repository)
Homebrew/homebrew-cask (Git revision cafd61346b; last commit 2021-08-17)
  • 查看 pod 版本

alex@Alexs-MacBook ~ % pod --version

1.5.2
  • 查看是否安装了多个版本的 ruby

alex@Alexs-MacBook ~ % rvm list

=* ruby-3.0.0 [ x86_64 ]

# => - current
# =* - current && default 
#  * - default
  • 查看当前 ruby 版本, 有且只有1个版本

alex@Alexs-MacBook ~ % rvm current

ruby-3.0.0
  • 再次尝试安装 pod

alex@Alexs-MacBook ~ % gem install cocoapods

ERROR: While executing gem ... (Gem::Exception)
    OpenSSl is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
  • 不愧是你, 又报错了! 提示 OpenSSL 不可用, 解决方法有2个

    1. 安装 OpenSSL, 并且重新构建 Ruby
    2. 使用 非HTTPS 的源, 也就是 HTTP
  • 查看是否安装 OpenSSL

alex@Alexs-MacBook ~ % openssl version

LibreSSL 2.8.3
  • 不太清楚openssl和Libressl的区别, 那就采用第2种方法, 换HTTP
  • 操作步骤很熟悉, 宋丹丹告诉我的
    1. 把冰箱门打开 (查看当前source) ✅

      alex@Alexs-MacBook ~ % gem source -l

      *** CURRENT SOURCES ***
      
      https://gems.ruby-china.com
      
    2. 把大象装进去 (移除HTTPS源) ✅

      alex@Alexs-MacBook ~ % gem sources --remove gems.ruby-china.com

      https://gems.ruby-china.com removed from sources
      
    3. 把冰箱门带上 (添加HTTP源) ❌

      alex@Alexs-MacBook ~ % gem sources -a gems.ruby-china.com

      ERROR: While executing gem ... (Gem::Exception)
          OpenSSl is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
      
  • 可恶, 由于冰箱太小, 塞不下大象, 又报错了
    • 添加HTTP源也需要openssl, 这让人摸不到头脑
  • 查看当前源的状态, 不出所料, 已经为空

alex@Alexs-MacBook ~ % gem source -l

*** CURRENT SOURCES ***

  • 这可如何是好, 气氛再一次陷入焦灼!
  • 查看本机openssl

alex@Alexs-MacBook ~ % which openssl

/usr/bin/openssl\

alex@Alexs-MacBook ~ % openssl version

LibreSSL 2.8.3
  • 既然第2条路不同, 那就来安装 openssl

alex@Alexs-MacBook ~ % brew install openssl

Updating Homebrew...
fatal: Could not resolve HEAD to a revision 
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 13 casks.

Warning: No available formula or cask with the name "openssl".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.

==> Searching for a previously deleted formula (in the last month)... 
Error: No previously deleted formula found.

==> Searching taps on GitHub...
This formula was found in a tap: 
homebrew/portable-ruby/portable-openssl

To install it, run:
    brew install homebrew/portable-ruby/portable-openssl 
  • 这里还不算openssl安装完成, 提示继续用brew安装
  • 当时没看见底下的提示, 转而用另外一种形式

alex@Alexs-MacBook ~ % rvm pkg install openssl

Beware, 'rvm pkg ...' is deprecated, read about the new autolibs feature: 'rvm help autolibs'.

Checking requirements for osx.

Missing required packages: autoconf automake libtool pkg-config coreutils libyaml libksba readline zlib openssl@1.1 Somehow it happened there is no executable 'openssl',
run 'brew doctor' and make sure latest 'openssl@1.1' is installed properly.

Requirements installation successful.

Fetching openssl-1.0.1i.tar.gz to /Users/alex/.rvm/archives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed 
100 4318k 100 4318k 0 0 641k 0 0:00:06 0:00:06 --:--:-- 878k

Extracting openssl to /Users/alex/.rvm/src/openssl-1.0.1i.....
Configuring openssl in /Users/alex/.rvm/src/openssl-1.0.1i.....................-
Compiling openssl in /Users/alex/.rvm/src/openssl-1.0.1i.......................-
Installing openssl to /Users/alex/.rvm/usr............................................................................

Please note that it's required to reinstall all rubies:
    
    rvm reinstall all --force

Updating openssl certificates.....
  • 没有报错, 看样子openssl安装成功了 (又一次忽略了底部的提醒 rvm reinstall )
  • 尝试 把冰箱门带上 (添加源) 仍然报错, 没办法继续查询Google
  • 尝试带有openssl参数

alex@Alexs-MacBook ~ % rvm install 3.0.0 --with-openssl-dir=$rvm_path/usr

Already installed ruby-3.0.0.
To reinstall use:\

    rvm reinstall ruby-3.0.0
  • 尝试 reinstall 带有openssl参数的 ruby

alex@Alexs-MacBook ~ % rvm reinstall 3.0.0 --with-openssl-dir=$rvm_path/usr

ruby-3.0.0 - #removing src/ruby-3.0.0 - please wait
ruby-3.0.0 - #removing rubies/ruby-3.0.0 - please wait
Checking requirements for osx.

Missing required packages: autoconf automake libtool pkg-config coreutils libyaml libksba readline zlib openssl@1.1
Somehow it happened there is no executable 'openssl',
run 'brew doctor' and make sure latest 'openssl@1.1' is installed properly.

Requirements installation successful.

Installing Ruby from source to: /Users/alex/.rvm/rubies/ruby-3.0.0, this may take a while depending on your cpu(s)... 

ruby-3.0.0 - #downloading ruby-3.0.0, this may take a while depending on your connection...
ruby-3.0.0 - #extracting ruby-3.0.0 to /Users/alex/.rvm/src/ruby-3.0.0 - please wait
ruby-3.0.0 - #configuring - please wait
ruby-3.0.0 - #post-configuration - please wait
ruby-3.0.0 - #compiling - please wait
ruby-3.0.0 - #installing - please wait
ruby-3.0.0 - #making binaries executable - please wait
Installed rubygems 3.2.3 is newer than 3.0.9 provided with installed ruby, skipping installation, use --force to force installation.
ruby-3.0.0 - #gemset created /Users/alex/.rvm/gems/ruby-3.0.0@global
ruby-3.0.0 - #importing gemset /Users/alex/.rvm/gemsets/global.gems - please wait

Error running 'command gem install rubygems-bundler --no-document',

please read /Users/alex/.rvm/log/1629169564_ruby-3.0.0/gem.install.rubygems-bundler.log there was an error installing gem rubygems-bundler

ruby-3.0.0 - #generating global wrappers - please wait
ruby-3.0.0 - #gemset created /Users/alex/.rvm/gems/ruby-3.0.0
ruby-3.0.0 - #importing gemsetfile /Users/alex/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-3.0.0 - #generating default wrappers - please wait
ruby-3.0.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).

Install of ruby-3.0.0 - #complete

Ruby was built without documentation, to build it run: rvm docs generate-ri
Making gemset ruby-3.0.0 pristine - please wait
Making gemset ruby-3.0.0@global pristine - please wait

alex@Alexs-MacBook ~ % rvm list

=* ruby-3.0.0 [ x86_64 ]

# => - current
# =* - current && default 
#  * - default

alex@Alexs-MacBook ~ % rvm current

ruby-3.0.0

alex@Alexs-MacBook ~ % ruby --version

ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
  • 看样子终于把冰箱门带上了, 查看下结果

alex@Alexs-MacBook ~ % gem source -l

*** CURRENT SOURCES ***

alex@Alexs-MacBook ~ % gem sources -a gems.ruby-china.com

https://gems.ruby-china.com added to sources

alex@Alexs-MacBook ~ % gem source -l

*** CURRENT SOURCES ***

https://gems.ruby-china.com

正式安装 cocoapods

alex@Alexs-MacBook ~ % gem install cocoapods

Fetching nanaimo-0.3.0.gem
Fetching colored2-3.1.2.gem
Fetching claide-1.0.3.gem
Fetching CFPropertyList-3.0.3.gem
Fetching atomos-0.1.3.gem
Fetching xcodeproj-1.21.0.gem
Fetching ruby-macho-1.4.0.gem
Fetching nap-1.1.0.gem
Fetching molinillo-0.6.6.gem
Fetching gh_inspector-1.1.3.gem
Fetching fourflusher-2.3.1.gem
Fetching escape-0.0.4.gem
Fetching cocoapods-try-1.2.0.gem
Fetching netrc-0.11.0.gem
Fetching cocoapods-trunk-1.5.0.gem
Fetching cocoapods-search-1.0.1.gem
Fetching cocoapods-plugins-1.0.0.gem
Fetching cocoapods-downloader-1.4.0.gem
Fetching cocoapods-deintegrate-1.0.5.gem
Fetching ffi-1.15.3.gem
Fetching ethon-0.14.0.gem
Fetching typhoeus-1.4.0.gem
Fetching public_suffix-4.0.6.gem
Fetching fuzzy_match-2.0.4.gem
Fetching concurrent-ruby-1.1.9.gem
Fetching httpclient-2.8.3.gem
Fetching algoliasearch-1.27.5.gem
Fetching addressable-2.8.0.gem
Fetching thread_safe-0.3.6.gem
Fetching tzinfo-1.2.9.gem
Fetching i18n-1.8.10.gem
Fetching activesupport-5.2.6.gem
Fetching cocoapods-1.10.2.gem
Fetching cocoapods-core-1.10.2.gem

Successfully installed nanaimo-0.3.0
Successfully installed colored2-3.1.2
Successfully installed claide-1.0.3
Successfully installed CFPropertyList-3.0.3
Successfully installed atomos-0.1.3
Successfully installed xcodeproj-1.21.0
Successfully installed ruby-macho-1.4.0
Successfully installed nap-1.1.0
Successfully installed molinillo-0.6.6
Successfully installed gh_inspector-1.1.3
Successfully installed fourflusher-2.3.1
Successfully installed escape-0.0.4
Successfully installed cocoapods-try-1.2.0
Successfully installed netrc-0.11.0
Successfully installed cocoapods-trunk-1.5.0
Successfully installed cocoapods-search-1.0.1
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-downloader-1.4.0
Successfully installed cocoapods-deintegrate-1.0.5
Building native extensions. This could take a while...
Successfully installed ffi-1.15.3
Successfully installed ethon-0.14.0
Successfully installed typhoeus-1.4.0
Successfully installed public_suffix-4.0.6
Successfully installed fuzzy_match-2.0.4
Successfully installed concurrent-ruby-1.1.9
Successfully installed httpclient-2.8.3
A new major version is available for Algolia!
Please now use the https://rubygems.org/gems/algolia gem to get the latest features. Successfully installed algoliasearch-1.27.5
Successfully installed addressable-2.8.0
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.9
Successfully installed i18n-1.8.10
Successfully installed activesupport-5.2.6
Successfully installed cocoapods-core-1.10.2
Successfully installed cocoapods-1.10.2

Parsing documentation for nanaimo-0.3.0
Installing ri documentation for nanaimo-0.3.0
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for claide-1.0.3
Installing ri documentation for claide-1.0.3
Parsing documentation for CFPropertyList-3.0.3
Installing ri documentation for CFPropertyList-3.0.3
Parsing documentation for atomos-0.1.3
Installing ri documentation for atomos-0.1.3
Parsing documentation for xcodeproj-1.21.0
Installing ri documentation for xcodeproj-1.21.0
Parsing documentation for ruby-macho-1.4.0
Installing ri documentation for ruby-macho-1.4.0
Parsing documentation for nap-1.1.0
Installing ri documentation for nap-1.1.0
Parsing documentation for molinillo-0.6.6
Installing ri documentation for molinillo-0.6.6
Parsing documentation for gh_inspector-1.1.3
Installing ri documentation for gh_inspector-1.1.3
Parsing documentation for fourflusher-2.3.1
Installing ri documentation for fourflusher-2.3.1
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for cocoapods-try-1.2.0
Installing ri documentation for cocoapods-try-1.2.0
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for cocoapods-trunk-1.5.0
Installing ri documentation for cocoapods-trunk-1.5.0
Parsing documentation for cocoapods-search-1.0.1
Installing ri documentation for cocoapods-search-1.0.1
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-downloader-1.4.0
Installing ri documentation for cocoapods-downloader-1.4.0
Parsing documentation for cocoapods-deintegrate-1.0.5
Installing ri documentation for cocoapods-deintegrate-1.0.5
Parsing documentation for ffi-1.15.3
Installing ri documentation for ffi-1.15.3
Parsing documentation for ethon-0.14.0
Installing ri documentation for ethon-0.14.0
Parsing documentation for typhoeus-1.4.0
Installing ri documentation for typhoeus-1.4.0
Parsing documentation for public_suffix-4.0.6
Installing ri documentation for public_suffix-4.0.6
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for concurrent-ruby-1.1.9
Installing ri documentation for concurrent-ruby-1.1.9
Parsing documentation for httpclient-2.8.3
Installing ri documentation for httpclient-2.8.3
Parsing documentation for algoliasearch-1.27.5
Installing ri documentation for algoliasearch-1.27.5
Parsing documentation for addressable-2.8.0
Installing ri documentation for addressable-2.8.0
Parsing documentation for thread_safe-0.3.6
Installing ri documentation for thread_safe-0.3.6
Parsing documentation for tzinfo-1.2.9
Installing ri documentation for tzinfo-1.2.9
Parsing documentation for i18n-1.8.10
Installing ri documentation for i18n-1.8.10
Parsing documentation for activesupport-5.2.6
Installing ri documentation for activesupport-5.2.6
Parsing documentation for cocoapods-core-1.10.2
Installing ri documentation for cocoapods-core-1.10.2
Parsing documentation for cocoapods-1.10.2
Installing ri documentation for cocoapods-1.10.2

Done installing documentation for nanaimo, colored2, claide, CFPropertyList, atomos, xcodeproj, ruby-macho, nap, molinillo, gh_inspector, fourfl usher, escape, cocoapods-try, netrc, cocoapods-trunk, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, ffi, eth on, typhoeus, public_suffix, fuzzy_match, concurrent-ruby, httpclient, algoliasearch, addressable, thread_safe, tzinfo, i18n, activesupport, cocoapods-core, cocoapods after 18 seconds

34 gems installed

alex@Alexs-MacBook ~ % pod --version

1.10.2
  • 这一刻, 终于迎来了胜利✌️

最后一步, 安装项目所需pods

alex@Alexs-MacBook repo % pod install

Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project

Pod installation complete! There are 32 dependencies from the Podfile and 86 total pods installed.

后记

从这次折腾的情况看, 还没有 完全掌握 cocopods 的原理, 有一些谜团仍未解开. 尽管这不影响后续的开发工作, 但总归是留下了 心理阴影, 下次重装cocoapods可能还要趟一遍水, 想想就焦虑和难受. 哈哈哈