rails server cannot start; getaddrinfo: nodename nor servname provided, or not known (SocketError)

旧巷老猫 提交于 2019-11-29 02:37:25

The problem solved by adding 127.0.0.1 localhost record to the private/etc/hosts file, which was removed by some reason before.

Try changing to UNIX Encoding:

brew install dos2unix
sudo dos2unix -c mac /private/etc/hosts

I had a similar problem with Redis in a rails environment. I added the port number and "Redis" to my /private/etc/hosts file on my mac, and it solved the error. Say your port number is "1234", you would add: 1234 redis. In the case of localhost, you would add: 127.0.0.1 localhost. I hope this provides at least some clues to your particular issue.

For any future users who run into this issue I was able to solve it by adding the following at the end of my private/etc/hosts file.

127.0.0.1 YOURNAME-MacBook-Pro.local

Update YOURNAME-MacBook-Pro to whatever the name of your machine is and hopefully you'll be all set.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!