我在Mac上使用Aptana Studio3。我试图在调试模式下运行我的服务器,这样我就可以设置断点并逐步执行我的代码。我创建了以下调试配置
使用"server“参数...
然而,当我在调试模式下启动我的服务器时(通过右键单击我的项目,选择debug As -> Debug Configurations,然后在我选择了上面的配置之后,在结果对话框中单击" Debug“按钮),服务器启动,但是当我调用代码(使用curl命令)来调用方法时,curl方法挂起,似乎是在断点处……
在Aptana Studio控制台中,我看到了"entered create“输出,但没有看到”完成构建“行。但是Aptana IDE没有像我期望的那样突出显示我设置断点的那一行。下面是Aptana控制台。我还需要做些什么才能在调试模式下正确地与IDE交互?
Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 127.0.0.1:50900
=> Booting Puma
=> Rails 5.2.2.1 application starting in development
=> Run `rails server -h` for more startup options
[79989] Puma starting in cluster mode...
[79989] * Version 3.11.4 (ruby 2.5.1-p57), codename: Love Song
[79989] * Min threads: 5, max threads: 5
[79989] * Environment: development
[79989] * Process workers: 2
[79989] * Phased restart available
[79989] * Listening on tcp://0.0.0.0:3000
[79989] Use Ctrl-C to stop
[79989] - Worker 0 (pid: 80014) booted, phase: 0
[79989] - Worker 1 (pid: 80015) booted, phase: 0
Started POST "/users" for 127.0.0.1 at 2019-10-13 13:44:17 -0500
[1m[35m (5.5ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
Processing by UserController#create as JSON
Parameters: {"first_name"=>"Dave", "last_name"=>"Smith", "email"=>"test@example.com"}
entered create
发布于 2019-11-21 14:12:52
您采取的方法是正确的,据我所知,设置调试配置的步骤也是正确的。
解决方案1 :
使用rails s --debugger
并检查其是否正常工作。
修复的方法2 :
通过更新到ruby-debug-base19 (0.11.25) ruby-debug-ide19 (0.4.12) ruby-debug19 (0.11.6)
并验证一次来尝试一次。
修复:远程调试::的方法3
由于netbeans和Aptana共享相同的调试内核,我们也可以进行远程调试,这里提到的线程可以提供帮助。Remote debugging Rails application in Aptana Studio 3我们可以按照这些步骤进行,以确保远程调试正常工作。
基本上,使用rdebug-ide -p 7000
(或您想要的任何端口)运行ruby应用程序,然后在集成开发环境中,转到Run > Debug configurations
。在左侧,选择"Remote Ruby Debug Session"
,然后在其中添加一个新配置(列表上方的加号图标)。输入您在命令行中输入的正确主机IP/名称和端口。
如果我们有一个rake文件和要执行的任务,我们如何调试?如果我们正在使用一个rake文件和要执行的任务,您可以在这里的线程中引用How to debug ruby tests in Eclipse/Aptana Studio? 1.运行>调试为>调试配置。然后在Ruby应用程序下添加一个条目。将其指向您的rake脚本路径(say /usr/local/bin/rake)
作为要启动的文件。2.应该编辑论据,将应用程序的Rakefile作为第一个参数传递,将rake任务作为第二个参数传递。(即/my/path/to/project/Rakefile build
)。
注意:有时可能有特定gem导致问题的可能性,如果我们删除一个gem,然后捆绑它,并尝试它可能会起作用,如果什么都不起作用,尝试这个。
https://stackoverflow.com/questions/58366746
复制