Rails Server Saves Exit (SocketError)

Rails noob is here. I try to work with Michael Hartl Ruby in the Rails Tutorial, but every time I start the rails server, it continues to Exiting and shows me a SocketError. Last weekend, I was able to start the server using wifi from startup, so I guess this has something to do with my internet connection / firewall? Today I ran into the same problem with the server in the library.

Any help is appreciated! Thanks in advance.

=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-02-23 22:33:11] INFO  WEBrick 1.3.1
[2015-02-23 22:33:11] INFO  ruby 2.2.0 (2014-12-25) [x86_64-darwin14]
Exiting
/Users/awo/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/socket.rb:232:in  `getaddrinfo': getaddrinfo: nodename nor servname provided, or not known (SocketError)
+1
source share
3 answers

I had the same issue recently that I resolved by adding an entry 127.0.0.1 localhostto a fileprivate/etc/hosts

+3
source

, ( ), , . :

##
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

, , - , / /etc/hosts.

+2

First you need to identify the rails server port identifier, so run the command below specifying a list of PIDs that works on 3000 ports

lsof -wni tcp:3000

PID column number to kill process:

kill -9 PID
0
source

All Articles