今天由于項(xiàng)目開(kāi)發(fā)需求 需要集成下友盟推送浇衬,本以為輕車熟路挠锥,對(duì)著開(kāi)發(fā)文檔準(zhǔn)備一波行云流水的操作。卻發(fā)現(xiàn)友盟更新的'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)這就很尷尬啊饭玲。
搜索才發(fā)現(xiàn)是Github在不久之前的2018年2月23號(hào)移除了一些低加密標(biāo)準(zhǔn)協(xié)議侥祭,包括TLSv1/TLSv1.1,diffie-hellman-group1-sha1茄厘,diffie-hellman-group14-sha1矮冬,相關(guān)鏈接在這里:Weak cryptographic standards removed。
這就意味著Mac系統(tǒng)對(duì)應(yīng)的openssl也需要更新次哈。更新命令搬在下面:
$echo'export PATH="/usr/local/opt/openssl/bin:$PATH"'>> ~/.bash_profile
/usr/local/opt/openssl/bin/openssl
以上是更新mac的openssl胎署,我上來(lái)就擼了一遍,在執(zhí)行更新cocoapods窑滞,并沒(méi)有什么卵用啊琼牧。在百度媽媽的精心輔導(dǎo)下,終于還是很順利的搞定了
1.了解當(dāng)前安裝的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.開(kāi)始安裝:sudo gem install cocoapods (輸入密碼后耐心等待一段時(shí)間葛假。障陶。。聊训。抱究。。带斑。鼓寺。)
如果出現(xiàn) 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)
執(zhí)行命令 :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