Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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 48,318 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