title: Trying to run WEBrick for Rails application, but keep getting error: "Only one usage of each socket..."
body: <p>Info: Rails 3.0.9; Ruby 1.8.7; Windows 7</p>
  
  <p>I just switched from mysql to postgresql in my Rails environment, and I cannot for the life of me get around this error when trying to run rails s on port 3000:</p>
  
  <p><em>WARN TCPServer Error: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2)</em></p>
  
  <p>I'm developing back and forth between two computers using dropbox, and everything works just fine on my home computer. But at work, this issue is driving me crazy.</p>
  
  <p>I've researched this question all over the internet, and I don't feel any of the answers have applied. The obvious answer is that the port is occupied. But I can't identify anything in my processes or using netstat in the command prompt that would be using this port.</p>
  
  <p>This link <a href="http://oldwiki.rubyonrails.org/rails/pages/MysteryProcessHoldsOntoWebrickPort" rel="nofollow">http://oldwiki.rubyonrails.org/rails/pages/MysteryProcessHoldsOntoWebrickPort</a> describes my problem exactly, but none of the solutions have worked. I've tried changing the port to 3001 using the -p option, but then I get this error:</p>
  
  <p><em>could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "???" and accepting TCP/IP connections on port 5432?</em></p>
  
  <p><em>could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "???" and accepting TCP/IP connections on port 5432?</em></p>
  
  <p>This same message also appears if I try to run rake db:migrate. </p>
  
  <p>So aside from the methods I've already mentioned, I have no idea how identify and remedy the cause of this error.</p>
  
  <p>I'm somewhat new to programming, so I may be overlooking something. Any help would be much appreciated.</p>