title: How to stop/start rails/webrick when using JRuby with nailgun?
body: <p>This is probably a stupid question, but not having much joy researching it myself.</p>
  
  <p>Using JRuby 1.6.4 on OSX (Snow Leopard) installed via rvm.</p>
  
  <p>I have <a href="http://samuel.kadolph.com/2011/08/speeding-up-jruby-with-nailgun/" rel="nofollow">enabled nailgun</a> .</p>
  
  <p>Can start rails/webrick (rails s) and things seem fine.</p>
  
  <p>Now I want to stop/start rails - how do I do that?</p>
  
  <p>I did the usual Control-C, which looks to kill the rails command - however, as its really running on the background nailgun daemon, its not killed.  </p>
  
  <p>If I restart rails now, I get an error about port 3000 in use - its trying to start a second webrick.</p>
  
  <p>If I kill the background daemon (using kill), JRuby then fails to start (connection refused).  Starting a new terminal window seems to fix this.</p>
  
  <p>This doesnt seem like the right way to be doing this, but what is?</p>
  
  <p>I have looked at <a href="http://blog.headius.com/2009/05/jruby-nailgun-support-in-130.html" rel="nofollow">Headius' guide</a> and the <a href="http://www.martiansoftware.com/nailgun/" rel="nofollow">Nailgun project page</a> - but neither go that far...</p>