解决方案如下:
更新了 openssl、ruby、cocoaPod。
$ which openssl
/usr/bin/openssl
$ openssl version
OpenSSL 0.9.8zh 14 Jan 2016
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update
$ brew install openssl
$ brew upgrade openssl
`` If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
$ which openssl
/usr/local/opt/openssl/bin/openssl
$ openssl version
OpenSSL 1.0.2n 7 Dec 2017
$ brew install rbenv ruby-build
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
$ source ~/.bash_profile
$ rbenv install --list
Available versions:
1.8.5-p52
1.8.5-p113
1.8.5-p114
1.8.5-p115
1.8.5-p231
1.8.6
:
2.1.0
2.1.1
2.1.2
:
$ rbenv install 2.5.0
$ rbenv versions
* system (set by /Users/username/.rbenv/version)
2.5.0
$ ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
$ rbenv global 2.5.0
$ rbenv versions
system
* 2.5.0 (set by /Users/username/.rbenv/version)
$ ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
$ gem install cocoapods -n /usr/local/bin
$ which pod
/usr/local/bin/pod
$ pod --version
1.4.0
这里是分隔符==============================================
以下是解决错误走的弯路,哈哈哈
1.执行
pod setup
执行之后,报如下错误:
使用:
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
即可。
然后,执行搜索操作:
pod search MJRefresh
2.但是,执行 pod install,出现:
3.根据错误提示输入:
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
4.啥玩意,让我执行 pod setup???,好吧,那在执行一次
pod setup
5.最后执行:
pod repo update --verbose
6.感觉有戏,执行 pod install,还是再次出现2中的错误,卒!!!
=================================================================
个人博客
Github
个人公众号:Flutter小同学
个人网站