記錄mPaaS安裝所遇到的阻力:
Mac OS : Mojave 10.14.2
Xcode : 10.1
螞蟻金服配置網(wǎng)址:https://tech.antfin.com/docs/2/51747
rubygems配置(mpaas要求>=V2.6.10):
gem -v
guomingjiandeMacBook-Pro:~ guomingjian$ gem -v
2.7.8
guomingjiandeMacBook-Pro:~ guomingjian$
gem source
见坑、 gem sources
嚷掠、 gem source -l
guomingjiandeMacBook-Pro:~ guomingjian$ gem source -l
*** CURRENT SOURCES ***
https://gems.ruby-china.com/
guomingjiandeMacBook-Pro:~ guomingjian$
gem 升級:sudo gem update --system
guomingjiandeMacBook-Pro:~ guomingjian$ sudo gem update --system
Password:
Latest version already installed. Done.
guomingjiandeMacBook-Pro:~ guomingjian$
rvm配置(mpaas要求>=V1.29.1):
guomingjiandeMacBook-Pro:~ guomingjian$ rvm -v
rvm 1.29.6 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
guomingjiandeMacBook-Pro:~ guomingjian$
rvm list
guomingjiandeMacBook-Pro:~ guomingjian$ rvm list
=* ruby-2.2.4 [ x86_64 ]
ruby-2.5.3 [ x86_64 ]
# => - current
# =* - current && default
# * - default
guomingjiandeMacBook-Pro:~ guomingjian$
ruby配置(mpaas指定要求v2.2,推薦v2.2.4):
ruby -v
guomingjiandeMacBook-Pro:~ guomingjian$ ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin18]
guomingjiandeMacBook-Pro:~ guomingjian$
安裝mPaaS
sh <(curl -s http://mpaas-ios.oss-cn-hangzhou.aliyuncs.com/mPaaS-Install-Tool/installmPaaS.sh )
老是報錯(打開xcode Edit并沒有mpaas荞驴,折騰好幾天都沒能裝上不皆,果斷放棄了!):
- gem install --source https://gems.ruby-china.com -i /Users/Shared/.mpaaskit_gems xcodeproj-1.7.0.gem;
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
- gem install --source https://gems.ruby-china.com -i /Users/Shared/.mpaaskit_gems reuse_xcode_plugins-0.2.3.gem;
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
- gem install --source https://gems.ruby-china.com -i /Users/Shared/.mpaaskit_gems cocoapods-0.37.2.gem;
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
PS:mPaaS插件是下載下來了:
前往路徑~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
shift+command+.
(打開熊楼、隱藏文件)
mpaas彈窗也不一致EΑ!
defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-10.1
=========================分割線=========================
ruby 2.2.4 導致cocoapods都不能用鲫骗!
guomingjiandeMacBook-Pro:~ guomingjian$ pod --version
Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0
/Library/Ruby/Site/2.3.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.3.0/rubygems.rb:308:in `activate_bin_path'
from /usr/local/bin/pod:23:in `<main>'
guomingjiandeMacBook-Pro:~ guomingjian$
把ruby指定到已安裝的另一個版本:v2.5.3
rvm use 2.5.3 --default
guomingjiandeMacBook-Pro:~ guomingjian$ rvm use 2.5.3 --default
Using /Users/guomingjian/.rvm/gems/ruby-2.5.3
guomingjiandeMacBook-Pro:~ guomingjian$
pod --version
guomingjiandeMacBook-Pro:~ guomingjian$ pod --version
1.5.3
guomingjiandeMacBook-Pro:~ guomingjian$
如果2.5.3還不行你需要執(zhí)行下面兩個命令:
sudo gem uninstall cocoapods
按提示輸入密碼犬耻,然后回車
gem install cocoapods
有mPaaS這方面經(jīng)驗的小伙伴加群交流:286380794
===============================================
問題已經(jīng)解決了,原因是openSSL問題挎峦,導致rvm2.2.4安裝有問題!
解決方案比較老土:
參考鏈接:
1)http://www.reibang.com/p/32f068922baf
2)https://ruby-china.org/topics/28575
安裝好了openSSL后合瓢,去官網(wǎng)下載rvm2.2.4坦胶,放入ruby路徑。
1)which openssl (獲取OpenSSL安裝路徑晴楔,保存一下)
/usr/local/opt/openssl/bin/openssl
2)cd /Users/guomingjian/.rvm/rubies/ruby-2.2.4 (用戶名自行替換)
3)./configure --with-openssl-dir=/usr/local/opt/openssl/bin/openssl
4)make
5)sudo make install
6)// 更新gem顿苇,重新根據(jù)mpaas教程進行安裝。
7)恢復簽名 : reuse_xcode_plugins --restore