Here are a few things you can do when a locally-run web server port is in use and your server won't start back up.
It's great fun to not manually restart a local server on every change in your program, except for this very occasional issue I've come across. This happened when I would tab out of my VS Code window (configured to autosave my app as I leave), which triggers a rerun-fueled refresh in my browser.
Command + R my webpage anyway to restart my user path, and with the right timing, I would get an error along the lines of
port is in use.
My first stop on Google was this Stack Overflow page which gave me a two-step solution: See if any processes were listening to the port my server was on by running:
(ruby was indeed listening to that port, which meant it was blocking my server from restarting on that port), and then run:
kill $(lsof -t -i:9292)
to clear the way for a server restart.
Soon after running into this myself, the same issue came up in class and another solution was shown:
npx kill-port 9292