求助解决phraseapp: command not found错误——使用fastlane拉取Phraseapp最新变更失败
phraseapp: command not found in fastlane's phraseapp_all Hey there, that error code 127 tells us fastlane can't locate the phraseapp command in its runtime environment—even if you can run it in your regular terminal. Let's walk through some practical fixes:
1. Use the absolute path to the phraseapp CLI
First, find exactly where phraseapp is installed on your system by running this in your terminal:
which phraseapp
You’ll get a path like /usr/local/bin/phraseapp (Intel Mac) or /opt/homebrew/bin/phraseapp (Apple Silicon). Then update your phraseapp_all lane to use this full path instead of just phraseapp:
lane :pull_phrases do sh "cd ../Project/Resources && /usr/local/bin/phraseapp pull" end
2. Verify fastlane's PATH environment
Fastlane might run in a different shell context than your terminal, so its PATH might not include the directory where phraseapp lives. Add a line to your lane to print the PATH and check:
lane :pull_phrases do sh "echo $PATH" # This shows you which paths fastlane can access sh "cd ../Project/Resources && phraseapp pull" end
If the directory from which phraseapp isn’t in that output, add it directly to fastlane’s PATH in the lane:
lane :pull_phrases do ENV['PATH'] = "/opt/homebrew/bin:#{ENV['PATH']}" # Replace with your phraseapp directory sh "cd ../Project/Resources && phraseapp pull" end
3. Use Bundler to manage the phraseapp gem
If you installed phraseapp via Ruby gem, make sure it’s listed in your project’s Gemfile:
gem 'phraseapp'
Run bundle install to sync dependencies, then update your lane to use bundle exec—this ensures fastlane uses the gem from your project’s bundle:
lane :pull_phrases do sh "cd ../Project/Resources && bundle exec phraseapp pull" end
4. Check your shell configuration and installation method
- If you installed
phraseappvia Homebrew, confirm Homebrew’s bin directory is in yourPATH. Add this line to your.zshrcor.bashrcif missing:
Restart your terminal or runexport PATH="/opt/homebrew/bin:$PATH" # Adjust path for your Mac typesource ~/.zshrcto apply changes. - Avoid running fastlane with
sudo—this switches the user context and can break access to user-installed tools likephraseapp.
5. Reinstall phraseapp cleanly
If you’re using the Ruby gem, uninstall and reinstall it to fix any linking issues:
gem uninstall phraseapp gem install phraseapp
If you’re using the standalone CLI (not the gem), download the latest version and place it in a directory that’s already in your PATH.
内容的提问来源于stack exchange,提问作者Jongers

