Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKern Tallett
10,012 PointsI am getting an error message when i try to start the rails server
/Users/Kern/.rbenv/versions/2.1.0/lib/ruby/2.1.0/socket.rb:206:in `bind': Address already in use - bind(2) for 0.0.0.0:3000 (Errno::EADDRINUSE)
Any ideas what is going on?
4 Answers
Scott Magdalein
1,667 PointsTo see what's running on port 3000, type the following into the terminal: lsof -i tcp:3000
It should show you the open file or process on that port. To kill that process (so you can free up port 3000 for your Rails server), copy the PID number and then type this into your terminal: kill -QUIT <PID>
(remember to replace <PID>
with the number you copied before)
Now port 3000 should be open for your Rails server. Alternatively, you could specific the port Karl Coelho stated above.
Sergio Barrera
4,198 PointsHi Kern, I think you're trying to start up another server instance on the webrick server. Check your terminal window(s) and see if there is a localhost:300 server already running for the same project/rails app.
karlcoelho
1,361 PointsEither run the start on another port, by
rails s -p 4000
or restart Terminal. If that doesn't work. Restart the computer.
Kern Tallett
10,012 PointsThanks guys both were correct in the sense as the first was the reason and the second was what i should do. I just forget sometimes restarting the computer can really help. I am unsure if i can give best answer to both. I am guessing not as it simply would be against the spirit of it but thanks both of you.