Updating fastlane fails: signet requires Ruby version >= 2.4.0

Viewed 9025

I'm unable to update fastlane.

When I execute fastlane update_fastlane I get the following error.

ERROR:  Error installing fastlane:
signet requires Ruby version >= 2.4.0.

When I execute ruby -v I get ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]

I'm stuck at fastlane version 2.28.3. I have tried reinstalling fastlane but I still get the same error.

What can be the cause of this issue? How can I resolve this?

3 Answers

Use this approach.

Remove fastlane from homebrew. Open terminal and run:

brew cask uninstall fastlane

Install ruby environments. Run in terminal:

brew install rbenv ruby-build
echo "" >> ~/.bash_profile
echo 'export PATH=${HOME}/homebrew/bin:${PATH}' >> ~/.bash_profile
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
rbenv install 2.6.5
rbenv global 2.6.5
exit

Open terminal again and run:

gem install fastlane
fastlane -v

Inspiration form: https://hackernoon.com/the-only-sane-way-to-setup-fastlane-on-a-mac-4a14cb8549c8

You just need to replace the old ruby with the lastest one.

  1. Find the lastest one. Execute which ruby, my result is /usr/local/opt/ruby/bin/ruby.

  2. Find the old one. It's /Users/username/.fastlane/bin/bundle/bin/ruby

  3. Replace it. Done.

Related