Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

The terminal cannot find the fastlane command

Errorzsh: command not found: fastlane

Short answer

The shell finds commands only in folders listed in PATH. fastlane is missing when it was never installed, when it lives in a Bundler setup that needs bundle exec, or when it installed into a folder that PATH does not list. Run command -v fastlane and gem environment to see which one you have.

  • Applies to fastlane 2, Ruby 3.3, Homebrew 4, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check whether the shell finds it, then ask RubyGems and Homebrew where they put executables. The output tells you which cause below applies.

    command -v fastlane
    gem environment gemdir
    brew --prefix
  2. 2Match what you see, then jump to its fix

    1. 1command -v prints nothing, and neither brew list nor gem list shows fastlanefastlane is not installed on this Mac or user accountFix
    2. 2A Gemfile with gem "fastlane" sits in the project, and fastlane is not installed system-wideThe project uses Bundler, so the command exists only through bundle execFix
    3. 3brew list shows fastlane, but command -v prints nothing, or brew itself is not foundHomebrew's folder is not on PATHFix
    4. 4gem list shows fastlane, but the command is not foundA gem install put the executable in a folder PATH does not listFix

What does the error look like?

  • zsh: command not found: fastlane
  • fastlane: command not found

Cause 1 of 4

fastlane is not installed on this Mac or user account

1Check

Look for the tool in both package managers.

brew list --formula | grep fastlane
gem list fastlane

2Fix

Install the Xcode command line tools, then install fastlane with Homebrew, which brings a suitable Ruby. The fastlane docs list Bundler as the recommended route for a project.

xcode-select --install
brew install fastlane

3Verify

The command resolves and prints its version.

fastlane --version

Confirmed by docs.fastlane.tools

Did this fix it?

Cause 2 of 4

The project uses Bundler, so the command exists only through bundle exec

1Check

A Gemfile means the gem is installed for the project, not put on PATH.

cat Gemfile
bundle exec fastlane --version

2Fix

Install the bundle and run every lane through Bundler, as the fastlane docs describe.

gem install bundler
bundle install
bundle exec fastlane [lane]

3Verify

The version prints when called through Bundler.

bundle exec fastlane --version

Confirmed by docs.fastlane.tools

Did this fix it?

Cause 3 of 4

Homebrew's folder is not on PATH

1Check

Homebrew prints setup directions after its installer finishes, and says it will not work without following them. On Apple Silicon the default prefix is /opt/homebrew.

ls /opt/homebrew/bin/fastlane
echo $PATH

2Fix

Add Homebrew's environment to your shell config file, then open a new terminal window.

# ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

3Verify

A new terminal resolves the command.

command -v fastlane

Confirmed by docs.brew.sh

Did this fix it?

Cause 4 of 4

A gem install put the executable in a folder PATH does not list

1Check

RubyGems has a gem directory and an executable directory. Ask it where gems live, and compare with the folders in your PATH.

gem environment gemdir
echo $PATH

2Fix

Reinstall with an executable folder that is already on PATH (the -n or --bindir option of gem install sets it), or use Homebrew or Bundler instead.

mkdir -p "$HOME/bin"
gem install fastlane --bindir "$HOME/bin"
# ~/.zshrc
export PATH="$HOME/bin:$PATH"

3Verify

Open a new terminal and check the command resolves.

command -v fastlane

Confirmed by guides.rubygems.org

Did this fix it?

How do I stop it coming back?

  • Pick one install route per machine, Homebrew or Bundler, and write it in the project README.
  • On CI make bundle install the first build step and call lanes with bundle exec.
  • Set a UTF-8 locale (LC_ALL and LANG) in the shell profile, as the fastlane setup page asks.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.