title: system and fork calls are blocking the port 3000
body: <p>I am using ruby 1.8.7 and rails 2.3.4 . I am developing a plugin so I don't have too much of leeway.</p>
  
  <p>In my controller I need to invoke a rake task. The rake task will take longer to finish so I am following the approach mentioned in <a href="http://railscasts.com/episodes/127-rake-in-background" rel="nofollow noreferrer">Railscast</a> which is</p>
  
  <pre><code>system "rake #{task} &amp;"
  </code></pre>
  
  <p>This solution works great and everything is fine. I know this solution will not work on windows and I'm fine with that.</p>
  
  <p>I started my server at port 3000. The controller was invoked which fired the rake task in the background. However if I ctrl +c my script/server and if I try to restart the server then I get this error.</p>
  
  <p>Address already in use - bind(2) (Errno::EADDRINUSE)</p>
  
  <p>Then I changed my code to do this</p>
  
  <pre><code>fork do
   system "rake #{task} &amp;"
  end
  </code></pre>
  
  <p>Still the same issue. </p>
  
  <p>Does anyone how do I get around this problem of port 3000 getting blocked. Also any explanation of why rake task is blocking port 3000 would help.</p>