即使该方法有效,该方法也将相当慢并且太复杂,我希望有一个更集成"的方法.调试.可能吗?解决方案由于Aptana/RadRails和Netbeans共享相同的调试器内核,因此NetBeans的旧步骤相对较近: http://blogs.oracle.com/martink/entry/remote_debugging_debug_whatever_ruby基本上,使用rdebug-ide -p 7000(或所需的任何端口)运行ruby应用程序,然后在IDE内部,转到运行">调试配置".在左侧,选择远程Ruby调试会话",然后在此处添加新配置(列表上方的加号图标).在命令行中输入正确的主机IP/名称和端口.My Rails development IDE is Aptana Studio 3.0.5, running on Windows.The applications runs on Apache + ModRails (Phusion Passenger) on a separate CentOS Linux machine. I have both Rails 2.x and 3.x applications.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)I've tried this:Using Rack::Debug: It creates only unix socket, cannot be connected remotely.Using ruby-debug directly:I added this to my /config/environments/development.rb: 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 Sprinking my code with debugger 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).Also, this method would be rather slow and too convoluted even if it worked, I'd like to have a more "integrated" debugging. Is it possible at all? 解决方案 The old steps for Netbeans are relatively close since Aptana/RadRails and Netbeans share the same debugger core: http://blogs.oracle.com/martink/entry/remote_debugging_debug_whatever_rubyBasically, 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. 这篇关于Aptana Studio 3中的远程调试Rails应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 15:04
查看更多