2

我的 Rails 开发 IDE 是Aptana Studio 3.0.5,在 Windows 上运行。这些应用程序在单独的 CentOS Linux 机器上运行在 Apache + ModRails (Phusion Passenger) 上。我有 Rails 2.x 和 3.x 应用程序。

我希望能够在 Aptana Studio 中使用调试器(远程连接到正在运行的应用程序)。显然有一些规定,但我无法弄清楚我在服务器端需要什么(在我的 Rails 应用程序配置中)

我试过这个:

  1. 使用 Rack::Debug:它只创建 unix 套接字,不能远程连接。

  2. 直接使用 ruby​​-debug:

    我将此添加到我的/config/environments/development.rb

    如果 File.exists?(File.join(RAILS_ROOT,'tmp', 'debug.txt'))  
      需要“红宝石调试”  
      Debugger.wait_connection = true
      Debugger.start_remote("real.hostname", 5000, 5001)
      File.delete(File.join(RAILS_ROOT,'tmp','debug.txt'))
    结尾
  

用语句喷洒我的代码debugger会停止执行,但我无法从 Aptana 连接到此实例,不能连接到端口 5000 和端口 5001(我不明白为什么我需要两个端口)。

此外,即使有效,这种方法也会相当缓慢且过于复杂,我希望进行更“集成”的调试。有可能吗?

4

1 回答 1

2

Netbeans 的旧步骤相对接近,因为 Aptana/RadRails 和 Netbeans 共享相同的调试器核心:http: //blogs.oracle.com/martink/entry/remote_debugging_debug_whatever_ruby

Basically, run the ruby app using rdebug-ide -p 7000 (or whatever port you want), then inside the IDE, go to Run > Debug configurations. On the left hand side, select "Remote Ruby Debug Session" and then add a new configuration there (the plus icon above the list). Enter the proper host IP/name and port you entered on the command line.

于 2011-11-02T15:37:51.583 回答