title: Remote debugging Rails application in Aptana Studio 3
body: <p>My Rails development IDE is <a href="http://aptana.com/" rel="nofollow noreferrer">Aptana Studio</a> 3.0.5, running on Windows.
  The applications runs on Apache + <a href="http://www.modrails.com/" rel="nofollow noreferrer">ModRails</a> (Phusion Passenger) on a separate CentOS Linux machine. I have both Rails 2.x and 3.x applications.</p>
  <p>I would like to be able to use the debugger in Aptana Studio (connect to the running application remotely). There are apparently some provisions for this, but I was unable to figure out what I need on the server side (in my Rails application configuration)</p>
  <h2>I've tried this:</h2>
  <ol>
  <li><p>Using Rack::Debug: It creates only unix socket, cannot be connected remotely.</p>
  </li>
  <li><p>Using ruby-debug directly:</p>
  <p>I added this to my <code>/config/environments/development.rb</code>:</p>
  </li>
  </ol>
    <pre>
      if File.exists?(File.join(RAILS_ROOT,'tmp', 'debug.txt'))  
        require 'ruby-debug'  
        Debugger.wait_connection = true
        Debugger.start_remote("real.hostname", 5000, 5001)
        File.delete(File.join(RAILS_ROOT,'tmp', 'debug.txt'))
      end
    </pre>
  <p>Sprinking my code with <code>debugger</code> statements stop the execution, but I cannot connect to this instance from Aptana, not to port 5000 and not port 5001 (and I don't understand why I need two ports there).</p>
  <p>Also, this method would be rather slow and too convoluted even if it worked, I'd like to have a more &quot;integrated&quot; debugging. Is it possible at all?</p>