调试 Shoes 应用程序的最佳方法是什么?
Shoes 有一些内置转储命令 (Shoes.debug),但是是否有其他工具可以调试代码而无需在整个过程中注入调试消息? 像 gdb 这样的东西会很棒。
Shoes has some built in dump commands (Shoes.debug), but are there other tools that can debug the code without injecting debug messages throughout? Something like gdb would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您还可以使用 Shoes.show_log 自动打开调试控制台。
You can also use Shoes.show_log to automatically open a debug console.
鞋子控制台。 按 Alt+/(或在 Mac 上按 apple+/)查看应用程序的堆栈跟踪。
The shoes console. Press Alt+/ (or apple+/ on a mac) to see the stack trace of your application.
请注意,如果您使用 Alt + /,则必须在启动应用程序“之前”运行它
Note that if you use Alt + / you'll have to run that "before" starting the app
你看过 ruby-debug gem 吗?
rdebug 可执行文件为您提供了与 gdb 类似的界面(断点设置等)。 您只需使用 rdebug 而不是 ruby 执行脚本即可。
您还可以执行类似的操作以避免手动设置断点:
这是有关 ruby-debug 的教程:
http://www.datanoise.com/articles/ 2006/7/12/ruby-debug 教程
Have you looked at the ruby-debug gem?
The rdebug executable gives you a similar interface to gdb (breakpoint setting, etc). You just simply execute your script with rdebug instead of ruby.
You can also do something like this to avoid manually setting breakpoints:
Here's a tutorial on ruby-debug:
http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug
我对这里提到的 Apple-/(或 Alt-/)位有点困惑。 我最终做的是不带任何参数运行./shoes,这会弹出控制台,然后使用./shoes my_app.rb启动我的应用程序。
I was a bit confused about the Apple-/ (or Alt-/) bit mentioned here. What I ended up doing was running ./shoes with no arguments, which popped up the console, then started my app with ./shoes my_app.rb.