Unable to troubleshoot why puma-dev is not working
vfonic opened this issue · comments
I've had puma-dev working in the past.
I've tried to open an app on .test domain today, but without success.
I've tried:
sudo puma-dev -setup
puma-dev -install
puma-dev -uninstall
puma-dev -install
...and any other possible combination.
I've tried symlinking to the (rails) app directory:
cd ~/.puma-dev; ln -s /absolute/path/to/rails/app appname
I've tried just adding a port number (used to work before):
cd ~/.puma-dev; echo "3000" > appname
I've tried different browsers.
The app is running on port 3000 and I can access it via http://localhost:3000
When I go to: http://appname.test/ I see there are no new logs in log/development.log
of the app.
Here are puma logs:
2020/10/02 14:20:21 Existing valid puma-dev CA keypair found. Assuming previously trusted.
* Directory for apps: /Users/viktor/.puma-dev
* Domains: test
* DNS Server port: 9253
* HTTP Server port: inherited from launchd
* HTTPS Server port: inherited from launchd
! Puma dev running...
! DNS Server failed: listen udp 127.0.0.1:9253: bind: operation not permitted
Could this last DNS error be the issue:
! DNS Server failed: listen udp 127.0.0.1:9253: bind: operation not permitted
Any ideas on how can I debug/fix this?
Could this last DNS error be the issue:
! DNS Server failed: listen udp 127.0.0.1:9253: bind: operation not permitted
Yes -- you won't be able to access .test
without DNS running properly.
I believe the macOS firewall is responsible for the failure. See #237 for previous discussion.
The workaround / solution is here: #237 (comment)
PUMA_DEV_BIN_PATH="$(brew --prefix puma/puma/puma-dev)/bin/puma-dev"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "$PUMA_DEV_BIN_PATH"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "$PUMA_DEV_BIN_PATH"
Closing this as duplicate.
Thanks @nonrational for speedy reply!
I've continued trying and eventually:
echo "3000" > appname
worked! :)
I did turn off the firewall, but it continued working as I turned the firewall back on and restarted the server.
The lats thing that enabled the puma-dev to work was killing the process running on port 80:
https://github.com/sindresorhus/fkill-cli
fkill :80
Note that I didn't follow the workaround steps you mentioned above.
Ah. If something else is running on port 80, then that'd also cause puma-dev to not function, since it tries to bind to port 80.
Happy puma-dev'ing!