Rails Warn Tcpserver Error Address Already In Use - Bind2exiting
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about address already in use - bind(2) rails hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Jekyll Error Address Already In Use
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. puppet tcpserver error: address already in use - bind(2) Join them; it only takes a minute: Sign up Rails server says port already used, how to kill that process? up vote 146 down vote favorite 73 I'm on a mac, doing: rails server I get: 2010-12-17 12:35:15]
Foreman Address Already In Use
INFO WEBrick 1.3.1 [2010-12-17 12:35:15] INFO ruby 1.8.7 (2010-08-16) [i686-darwin10.4.0] [2010-12-17 12:35:15] WARN TCPServer Error: Address already in use - bind(2) Exiting I know I can start one on a new port, but I want to kill this process. ruby-on-rails share|improve this question asked Dec 17 '10 at 17:36 Blankman 64.7k197564925 add a comment| 7 Answers 7 active oldest votes up vote 359 down vote accepted Assuming you're looking to kill whatever is on port 3000 (which is address already in use - bind - address already in use logstash what webrick normally uses), type this in your terminal to find out the PID of the process: $ lsof -wni tcp:3000 Then, use the number in the PID column to kill the process: $ kill -9 PID share|improve this answer answered Dec 17 '10 at 17:47 idlefingers 21.7k46566 1 could you please explain -wni –user993563 Aug 4 '12 at 20:25 Thanks for that!!! –Kyle Carlson May 11 '13 at 18:57 18 Just to clarify for novices: in the second line of code, you are supposed to replace the PID with the actual number that is shown in your console upon entering the first line of code (eg, 12345). –CodeBiker Aug 7 '13 at 18:48 1 You can also find the PID by navigating through your rails directory to the following file tmp/pids/server.pid –tandy Feb 15 '14 at 19:29 This can happen if you're running debugger in RubyMine and it crashes or something... The server stops but the debugger continues... Anyway, this is the solution I used and it works perfectly :) –J Smith Jun 22 '15 at 12:24 add a comment| up vote 52 down vote kill -9 $(lsof -i tcp:3000 -t) share|improve this answer answered Mar 5 '13 at 4:10 Bijan 2,83332324 can you please explain this command. what does it do ? –cvibha Jan 22 '15 at 0:27 1 everythin
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this
A Server Is Already Running
site About Us Learn more about Stack Overflow the company Business Learn more
Lsof -wni Tcp:3000
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss address already in use bind 2 for 0.0 0.0 port 3000 Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up WARN TCPServer Error: http://stackoverflow.com/questions/4473229/rails-server-says-port-already-used-how-to-kill-that-process Address already in use - bind(2) in linux EC2 and Heroku servers up vote 0 down vote favorite [2013-01-29 09:17:50] INFO WEBrick 1.3.1 [2013-01-29 09:17:50] INFO ruby 1.8.7 (2012-10-12) [i386-linux] [2013-01-29 09:17:50] WARN TCPServer Error: Address already in use - bind(2) [2013-01-29 09:17:50] INFO WEBrick::HTTPServer#start: pid=4107 port=8080 When I run the file attached below in linux I get the error described. I tried all http://stackoverflow.com/questions/14579594/warn-tcpserver-error-address-already-in-use-bind2-in-linux-ec2-and-heroku-s possible command and strategies online to listen to processes (including rogue) and kill them. I did this in lots of ports. No luck. As soon as I run the script in Mac OS and it works. Nevertheless I have to mount it on a server and clients have to communicate with it. It happens on every instance of amazon ec2 and on heroku. I have seen this error one too many times and spend many hours trying to fix it. I configured the security group of ec2 instances and still did not work. I am beyond desperate. At this point I have to think that the problem must be WEBrick itself or something in my code. require 'webrick' require 'uri' require 'net/http' $own_address = 8080 class AuctionInfo # The representation is a hash mapping item names to [highest_bidder, highest_bid, end_time] def initialize @data = {} end def new_item(item, endTime) @data[item] = ["UNKNOWN", 0, endTime] end def bid(item, bid, client) if @data.has_key?(item) endTime = @data[item][2] if @data[item][1].to_i < bid.to_i and Time.new.to_i < endTime.to_i @data[item] = [client, bid, endTime] end end end def get_status(item) if @data.has_key?(item) return @data[item][0] end end def winner(item) if @data.has_key?(item)
rails s https://www.ruby-forum.com/topic/196744 => Booting WEBrick => Rails 3.1.3 application starting in development on http://0.0.0.0:3000 => Call with -d to address already detach => Ctrl-C to shutdown server [2012-01-12 13:49:02] INFO WEBrick 1.3.1 [2012-01-12 13:49:02] INFO ruby 1.9.3 (2011-10-30) [x86_64-darwin11.2.0] [2012-01-12 13:49:02] WARN address already in TCPServer Error: Address already in use - bind(2) Exiting /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/utils.rb:85:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE) from /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/utils.rb:85:in `new' from /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/utils.rb:85:in `block in create_listeners' from /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/utils.rb:82:in `each' from /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/utils.rb:82:in `create_listeners' from /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:82:in `listen' from /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:70:in `initialize' from /Users/shiori/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:45:in `initialize' from /Users/shiori/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/handler/webrick.rb:10:in `new' from /Users/shiori/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/handler/webrick.rb:10:in `run' from /Users/shiori/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/server.rb:265:in `start' from /Users/shiori/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/server.rb:70:in `start' from /Users/shiori/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:54:in `block in
rm (ralu) on 2009-10-06 06:21 => Booting WEBrick => Rails 2.3.4 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2009-10-06 09:50:03] INFO WEBrick 1.3.1 [2009-10-06 09:50:03] INFO ruby 1.8.6 (2007-09-24) [i386-linux] [2009-10-06 09:50:03] WARN TCPServer Error: Address already in use - bind(2) Exiting /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 /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/webrick.rb:9:in `new' from /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/webrick.rb:9:in `run' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:111 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3 Report post Edit Move Delete topic Reply with quote Re: Errno::EADDRINUSE Brijesh Shah (brijesh) on 2009-10-06 12:05 > /usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Address already > in use - bind(2) (Errno::EADDRINUSE) address is already in use...You should try with different port number... script/server -p xxxx Ralu Rm wrote: Report post Edit Delete Reply with quote Re: Errno::EADDRINUSE Sijo k g (sijo) on 2009-10-06 12:44 Or kill the existing process From konsole type netstat -nlp|grep ruby Find out the PID Now kill -9 processid Sijo Report post Edit Delete Reply with quote Re: Errno::EADDRINUSE Ralu rm (ralu) on 2009-10-06 13:07 Sijo kg wrote: > Or kill the existing process From konsole type > > netstat -nlp|grep ruby Find out the PID Now > kill -9 processid > > > > Sijo thanks sijo.... problem solved!!! Report post Edit Delete Reply with quote Forum List Topic List New Topic Search Register User List Log In Enable email notification | Enable multi-page view Please log in before posting. Registration is free and takes only a minu