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 trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Generate a Scaffold

Kern Tallett
Kern Tallett
10,012 Points

I 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

To 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
Sergio Barrera
4,198 Points

Hi 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.

Either run the start on another port, by

rails s -p 4000

or restart Terminal. If that doesn't work. Restart the computer.

Kern Tallett
Kern Tallett
10,012 Points

Thanks 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.