When executing fastlane command in terminal, it shows the follow errors in MacOS 13.1 running on M1 chips
/Library/Ruby/Site/2.6.0/rubygems.rb:265:in `find_spec_for_exe': can't find gem fastlane (>= 0.a) with executable fastlane (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.6.0/rubygems.rb:284:in `activate_bin_path'
from /usr/local/bin/fastlane:23:in `<main>'
How to solve it?
fastlane is supposed to work as normal
According to the fastlane setup guideline https://docs.fastlane.tools/getting-started/android/setup/ , fastlane relies on the ruby + bundler but the system ruby is not recommended.
Thus, to install Ruby in another project scope instead of modifying the system environment, I tried install ruby 3.2.0 via rbenv and ruby-build .
However, it failed and the ruby version is different from the system installed one. I get the ruby version by executing
$ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]
Another approach is to install the fastlane by Homebrew
It showed another error as below:
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local): Please create a new installation in /opt/homebrew using one of the "Alternative Installs" from: https://docs.brew.sh/Installation You can migrate your previously installed formula list with: brew bundle dump
Currently my homebrew is in
$which brew
/usr/local/bin/brew
As a result, the idea to solve this issue is reinstall the homebrew in /opt/homebrew
direction.
Running this command,
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
followed by the steps in homebrew install guide
/opt/homebrew
I'm using zsh terminal, so just need to add a new eval config in your zsh config file.
$echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
You can see Homebrew path has been changed when reopen your zsh terminal.
$which brew
/opt/homebrew/bin/brew
$brew install fastlane
Fastlane works again!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.