upleveled / system-setup

Set up a PERN development environment on Windows, macOS and Linux
28 stars 19 forks source link

`flyctl` Linux instructions don't include the manual instructions #77

Closed ProchaLu closed 4 months ago

ProchaLu commented 4 months ago

A student on Linux Ubuntu 22.04.4 LTS has issues with the Deployment on Fly.io using flyctl. When running flyctl auth login the terminal returns with flyctl: command not found.

To fix this issue, we can use this workaround for Ubuntu 22.04.4 LTS

curl -L https://fly.io/install.sh | sh
export FLYCTL_INSTALL="/home/corna/.fly"
export PATH="$FLYCTL_INSTALL/bin:$PATH"

This is an incomplete setup, which will fail on new terminal tabs (it will not have the $FLYCTL_INSTALL environment variable or the $PATH update, and flyctl will not be found).

When installing flyctl by running curl on the https://fly.io/install.sh script, it will run the script below:

echo "flyctl was installed successfully to $exe"
if command -v flyctl >/dev/null; then
    echo "Run 'flyctl --help' to get started"
else
    case $SHELL in
    /bin/zsh) shell_profile=".zshrc" ;;
    *) shell_profile=".bash_profile" ;;
    esac
    echo "Manually add the directory to your \$HOME/$shell_profile (or similar)"
    echo "  export FLYCTL_INSTALL=\"$flyctl_install\""
    echo "  export PATH=\"\$FLYCTL_INSTALL/bin:\$PATH\""
    echo "Run '$exe --help' to get started"
fi

This will show output like this:

flyctl was installed successfully to /home/corna/.fly/bin/flyctl
Manually add the directory to your $HOME/.bash_profile (or similar)
  export FLYCTL_INSTALL="/home/corna/.fly"
  export PATH="$FLYCTL_INSTALL/bin:$PATH"

We need to edit the Linux guide to include explicit instructions for adding to the $PATH in either .zshrc or .bash_profile (based on the current shell), similar to how the React Native setup instructions work.

There are some community board entries reporting this problem: