Charles-Eric Legras4,917 Points
Localhost:3000 - not available
When I launch bin/rails server
I have this message:
[2015-02-16 17:43:38] INFO WEBrick 1.3.1
[2015-02-16 17:43:38] INFO ruby 2.0.0 (2014-05-08) [universal.x86_64-darwin14]
[2015-02-16 17:43:38] WARN TCPServer Error: Address already in use - bind(2)
initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
block in create_listeners'
block in <top (required)>'
from bin/rails:4:in `<main>'
I don't understand why, because I worked when I install the testapp...
Clayton PerszykTreehouse Moderator 46,805 Points
It looks like you're running another app on the same port (localhost:3000). You can only run one app per port, so you'll have to shut down the server for the other app.
Andrew Smith14,330 Points
This discussion is a bit old now, but I ran into the same problem today, seemingly out of the blue.
In the OSX console:
lsof -i tcp:3000
Find the port ID (PID) under the resulting listing, then:
kill -9 <PID>
Where PID is the port ID you obtained from running the "lsof" command above. Worked like a charm. Not sure if this syntax would work for Linux or Windows consoles.
I found this solution from Stackoverflow: http://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac