You’ve gotten pretty far, so I’m impressed! Next, make sure that Xcode is up to date and then install the Xcode command line tools by running this in a terminal:
sudo xcode-select --install
After that, try rerunning the failing step.
What version of macOS are you running?