记录mPaaS安装所遇到的阻力:
Mac OS : Mojave 10.14.2
Xcode : 10.1
蚂蚁金服配置网址: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弹窗也不一致!!
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还不行你需要执行下面两个命令:
sudo gem uninstall cocoapods
按提示输入密码,然后回车
gem install cocoapods
有mPaaS这方面经验的小伙伴加群交流:286380794
===============================================
问题已经解决了,原因是openSSL问题,导致rvm2.2.4安装有问题!
解决方案比较老土:
参考链接:
1)https://www.jianshu.com/p/32f068922baf
2)https://ruby-china.org/topics/28575
安装好了openSSL后,去官网下载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,重新根据mpaas教程进行安装。
7)恢复签名 : reuse_xcode_plugins --restore