cocoapods更新(Failed to connect to
今天由于项目开发需求 需要集成下友盟推送,本以为轻车熟路,对着开发文档准备一波行云流水的操作。却发现友盟更新的'UMCCommon'怎么也search不到,我的pod的版本低了?于是更新我的pod,却始终更新不了(Updating spec repo `master`[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please checkifyou are offline,orthat GitHubisdown)这就很尴尬啊。
搜索才发现是Github在不久之前的2018年2月23号移除了一些低加密标准协议,包括TLSv1/TLSv1.1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,相关链接在这里:Weak cryptographic standards removed。
这就意味着Mac系统对应的openssl也需要更新。更新命令搬在下面:
$echo'export PATH="/usr/local/opt/openssl/bin:$PATH"'>> ~/.bash_profile
/usr/local/opt/openssl/bin/openssl
以上是更新mac的openssl,我上来就撸了一遍,在执行更新cocoapods,并没有什么卵用啊。在百度妈妈的精心辅导下,终于还是很顺利的搞定了
1.了解当前安装的Ruby源地址:gem sources
*** CURRENT SOURCES ***
https://gems.ruby-china.org/
2.移除上面的镜像地址:gem sources --remove https://gems.ruby-china.org
source https://gems.ruby-china.org not present in cache
3.添加 :gem sources -a https://rubygems.org
https://rubygems.org added to sources
4.开始安装:sudo gem install cocoapods (输入密码后耐心等待一段时间。。。。。。。。)
如果出现 WARNING: Unable to pull data from 'https://gems.ruby-china.org/': bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)
执行命令 :curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.4.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.asc
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.asc',
but no GPG software exists to validate it, skipping.
Upgrading the RVM installation in /Users/wofuminshengkeji/.rvm/
RVM PATH line found in /Users/wofuminshengkeji/.mkshrc /Users/wofuminshengkeji/.profile /Users/wofuminshengkeji/.bashrc /Users/wofuminshengkeji/.zshrc.
RVM sourcing line found in /Users/wofuminshengkeji/.profile /Users/wofuminshengkeji/.bash_profile /Users/wofuminshengkeji/.zlogin.
Upgrade of RVM in /Users/wofuminshengkeji/.rvm/ is complete.
* No new notes to display.
5.查看ruby的版本: rvm list known
获得一一列的版本
6.安装最新的ruby的版本:rvm install ruby 2.4(我这里用的是2.4)
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.4.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/wofuminshengkeji/.rvm/rubies/ruby-2.4.4, this may take a while depending on your cpu(s)...
ruby-2.4.4 - #downloading ruby-2.4.4, 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 12.0M 100 12.0M 0 0 139k 0 0:01:28 0:01:28 --:--:-- 69894
ruby-2.4.4 - #extracting ruby-2.4.4 to /Users/wofuminshengkeji/.rvm/src/ruby-2.4.4.....
ruby-2.4.4 - #configuring......................................................-
ruby-2.4.4 - #post-configuration.
ruby-2.4.4 - #compiling........................................................-
ruby-2.4.4 - #installing.......
ruby-2.4.4 - #making binaries executable..
ruby-2.4.4 - #downloading rubygems-2.7.7
ruby-2.4.4 - #extracting rubygems-2.7.7......
ruby-2.4.4 - #removing old rubygems........
ruby-2.4.4 - #installing rubygems-2.7.7................................
ruby-2.4.4 - #gemset created /Users/wofuminshengkeji/.rvm/gems/ruby-2.4.4@global
ruby-2.4.4 - #importing gemset /Users/wofuminshengkeji/.rvm/gemsets/global.gem.|
ruby-2.4.4 - #generating global wrappers.......
ruby-2.4.4 - #gemset created /Users/wofuminshengkeji/.rvm/gems/ruby-2.4.4
ruby-2.4.4 - #importing gemsetfile /Users/wofuminshengkeji/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.4.4 - #generating default wrappers.......
ruby-2.4.4 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.4.4 - #complete
6.查看一下ruby版本:gem sources
*** CURRENT SOURCES ***
https://gems.ruby-china.org/
https://rubygems.org
7.在移除上面的镜像:gem sources --remove https://gems.ruby-china.org/
https://gems.ruby-china.org/ removed from sources
8.查看version: gem --version
9.安装pod :sudo gem install cocoapods