RoR: WARN TCPServer Error: Address already in use

I got the following error, when I started the rails server:

anmol@anmol-laptop:~/workshop$ ruby script/server
/usr/lib/ruby/1.8/xmlsimple.rb:275: warning: already initialized constant KNOWN_OPTIONS
/usr/lib/ruby/1.8/xmlsimple.rb:280: warning: already initialized constant DEF_KEY_ATTRIBUTES
/usr/lib/ruby/1.8/xmlsimple.rb:281: warning: already initialized constant DEF_ROOT_NAME
/usr/lib/ruby/1.8/xmlsimple.rb:282: warning: already initialized constant DEF_CONTENT_KEY
/usr/lib/ruby/1.8/xmlsimple.rb:283: warning: already initialized constant DEF_XML_DECLARATION
/usr/lib/ruby/1.8/xmlsimple.rb:284: warning: already initialized constant DEF_ANONYMOUS_TAG
/usr/lib/ruby/1.8/xmlsimple.rb:285: warning: already initialized constant DEF_FORCE_ARRAY
/usr/lib/ruby/1.8/xmlsimple.rb:286: warning: already initialized constant DEF_INDENTATION
/usr/lib/ruby/1.8/xmlsimple.rb:287: warning: already initialized constant DEF_KEY_TO_SYMBOL
=> Booting WEBrick…
=> Rails 2.1.0 application started on http://127.0.0.1:3000
=> Ctrl-C to shutdown server; call with –help for options
[2009-01-25 20:42:49] INFO  WEBrick 1.3.1
[2009-01-25 20:42:49] INFO  ruby 1.8.7 (2008-08-11) [i486-linux]
[2009-01-25 20:42:49] WARN  TCPServer Error: Address already in use – bind(2)
/usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize’: Address already in use – bind(2) (Errno::EADDRINUSE)
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `new’
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners’
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `each’
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners’
from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen’
from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize’
from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize’
from /home/anmol/workshop/vendor/rails/railties/lib/webrick_server.rb:58:in `new’
from /home/anmol/workshop/vendor/rails/railties/lib/webrick_server.rb:58:in `dispatch’
from /home/anmol/workshop/vendor/rails/railties/lib/commands/servers/webrick.rb:66
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require’
from /home/anmol/workshop/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in `require’
from /home/anmol/workshop/vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in `new_constants_in’
from /home/anmol/workshop/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in `require’
from /home/anmol/workshop/vendor/rails/railties/lib/commands/server.rb:39
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require’
from script/server:3

It seems that port 3000 is already in use . Try using the command mentioned below and see if it works :

ruby script/server -e production -p 3001

if the server starts then go the page : http://yourhost:3001/ .

I hope this will solve the problem.
Advertisements

3 thoughts on “RoR: WARN TCPServer Error: Address already in use

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s