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 trialCharles-Eric Legras
4,917 PointsLocalhost: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)
Exiting
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:85:in initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:85:in
new'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:85:in block in create_listeners'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:82:in
each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:82:in create_listeners'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:132:in
listen'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:113:in initialize'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:45:in
initialize'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in new'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in
run'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in start'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in
start'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in
tap'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in <top (required)>'
from bin/rails:4:in
require'
from bin/rails:4:in `<main>'
I don't understand why, because I worked when I install the testapp...
Please help
3 Answers
Clayton Perszyk
Treehouse Moderator 48,850 PointsHi Charles-Erik
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 Smith
14,330 PointsThis 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
Charles-Eric Legras
4,917 PointsThank you Clayton !!! You were right !!! :)
Jennifer Crawshaw
17,878 PointsJennifer Crawshaw
17,878 PointsI am having this issue as well, but I do not have any other apps running on that port, they are all shut down. Any suggestions?