Parv Bhasker
Parv Bhasker

Reputation: 1901

Getting error "command not found: fastlane"

I have tried following few tutorials but getting the same error every time.

I tried installing using bundle methods:

bundle init (in project repository)

I added gem "fastlane" in Gemfile and then used bundle install to install fastlane.

But when I fastlane init raises an error zsh: command not found: fastlane

following tutorial =

Upvotes: 2

Views: 5716

Answers (1)

Jay Lee
Jay Lee

Reputation: 1912

Try export PATH="$HOME/.fastlane/bin:$PATH" in your shell.

If it works, add it to the .zshrc to make it permanent. source .zshrc again in the same session or restart the shell (e.g., restart the terminal).

============= EDIT =============

Substitute export PATH="$HOME/.fastlane/bin:$PATH" with export PATH="/usr/local/bin/fastlane" if ~/.fastlane does not exist and /usr/local/bin/fastlane does. If cd ~/.fastlane works, proceed with $HOME/.fastlane/bin, and if it doesn't & ls /usr/local/bin | grep fastlane finds fastlane, substitute with /usr/local/bin/fastlane.

The export PATH="$HOME/.fastlane/bin:$PATH" part should be typed directly into the shell command line, i.e., the console you typed bundle init in.

If this solves your problem, then add the line export PATH="$HOME/.fastlane/bin:$PATH" to the end of your .zshrc file. This file can be found in your home directory ~. In the terminal, cd ~ and list all the files in the directory by ls -al. If you see .zshrc, open it with an editor of your choice, e.g., nano if you are new to command line tools, vim, pico, etc. At the end of the file, add

export PATH="$HOME/.fastlane/bin:$PATH"

If .zshrc does not exist, create one under your home directory and add the above line (Then your single-line .zshrc will only contain the above command.).

Upvotes: 2

Related Questions