Unable to start webbrick - TCPServer Error: Address already in use

Go To StackoverFlow.com

4

I am receiving the following error:

$rails server --binding=127.0.0.1
=> Booting WEBrick
=> Rails 3.1.1 application starting in development on http://127.0.0.1:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-04-04 13:02:35] INFO  WEBrick 1.3.1
[2012-04-04 13:02:35] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin10.8.0]
[2012-04-04 13:02:35] WARN  TCPServer Error: Address already in use - bind(2)
Exiting
/Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `new'
from /Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners'
from /Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:70:in `each'
from /Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners'
from /Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:74:in `listen'
from /Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize'
from /Users/TravisKs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize'
from /Users/TravisKs/.rvm/gems/ruby-1.9.2-p290@rvm-gemset-name/gems/rack-1.3.5/lib/rack/handler/webrick.rb:10:in `new' 
from /Users/TravisKs/.rvm/gems/ruby-1.9.2-p290@rvm-gemset-name/gems/rack-1.3.5/lib/rack/handler/webrick.rb:10:in `run' 
from /Users/TravisKs/.rvm/gems/ruby-1.9.2-p290@rvm-gemset-name/gems/rack-1.3.5/lib/rack/server.rb:265:in `start'
from /Users/TravisKs/.rvm/gems/ruby-1.9.2-p290@rvm-gemset-name/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start'
from /Users/TravisKs/.rvm/gems/ruby-1.9.2-p290@rvm-gemset-name/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in <top (required)>'
from /Users/TravisKs/.rvm/gems/ruby-1.9.2-p290@rvm-gemset-name/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap' 
from /Users/TravisKs/.rvm/gems/ruby-1.9.2-p290@rvm-gemset-name/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

After restarting my machine I still have this problem. I have reviewed other SO posts on the TCPServer error with Rails.

ps -eo pid,ppid,user,args,stat

Returns no results for rails

ps aux

Does not return any Zombie Processes (Z in the stat column) or Rails servers.

This is odd to me since everything was working fine. I switched a gemset, reinstalled Rails 3.1.1, and now I am unable to run it.

2012-04-04 20:17
by Travis
Does it start up if you explicitly set a port rails server -p 3001 - Michael Berkowski 2012-04-04 20:18
It does, I plan on some work around but would love to resolve this issue - Travis 2012-04-04 20:22
http://stackoverflow.com/questions/10261477/tcpserver-error-address-already-in-use-bind - Forbidden Overseer 2013-01-02 14:04
Rails server says port already used, how to kill that process? - http://stackoverflow.com/questions/4473229/rails-server-says-port-already-used-how-to-kill-that-proces - Connor Leech 2013-10-27 14:13


8

try running lsof | grep 3000 and then kill -9 <number of process> if it doesn't help, try running the rails server with -p 3001 option to change the port

2012-04-04 20:22
by FreeCandies
I get this but assume it's becuase of the 6300000 and not what we're looking for. \ Google 374 travisKs txt REG 14,2 630000 3910968 - Travis 2012-04-04 20:25
I had the same issue because I had an Aptana debug session running, which didn't show up with lsof. But the server started fine once I terminated the debug session - Peter Hall 2012-08-12 12:15


1

Well, i know it's to late to answer, but this very same day i had same problem.

All i did is, Restart my machine. seems like other application was using the same port !..

so, by simply restarting, problem solved!

2013-09-20 14:18
by Mawaheb
Ads