Follow the standard way of running:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
If it worked well bingo, bango! but if some fatal: ref...
error happened or it stucked at the final stage of installation with similar error: