首页 > 解决方案 > 运行 sudo gem install fastlane -NV 会抛出错误安装 fastlane ruby​​zip 需要 ruby​​ 版本 >= 2.4 时

问题描述

跑步

sudo gem install fastlane -NV 

安装 fastlane ruby​​zip requires ruby​​ version >= 2.4 时抛出错误

最初,环境设置是通过运行以下步骤完成的 -

如果已安装,请先卸载 rvm -

rvm -v 
rvm list
rvm uninstall {version_to_uninstall}
rvm use system - Switch to macOS default ruby version
rvm implode - uninstall rvm 

rbenv - Ruby Environment Manager - we will use this to install ruby
brew install rbenv ruby-build
rbenv install 2.3.7

Add the following line to .bash_profile - 
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

source ~/.bash_profile
rbenv global 2.3.7
ruby -v 

bundle install
bundle exec fastlane bootstrap 
open ProjectName.xcworkspace

标签: iosrubyxcodefastlane

解决方案


通过将 ruby​​ 版本更改为 2.6.0 进行修复,如下所示 -

rbenv install 2.6.0

rbenv global 2.6.0

Then - 

sudo gem install fastlane -NV

推荐阅读