ruby-on-rails - 是否可以逐步完成 RoR 应用程序?或者只使用调试断点进行调试?

标签 ruby-on-rails debugging

我读到您可以在 RoR 代码中放置一个“调试”符号,然后执行将在该点停止,然后您可以将任何内容吐出到控制台以查看变量的状态等。

有没有办法遍历每一行并遵循执行路径?

最佳答案

调试器本身有文档。 ns 是您要查找的命令。

(rdb:1) help
ruby-debug help v0.10.3
Type 'help <command-name>' for help on a specific command

Available commands:
backtrace  delete   enable  help    next  quit     show    trace    
break      disable  eval    info    p     reload   source  undisplay
catch      display  exit    irb     pp    restart  step    up       
condition  down     finish  list    ps    save     thread  var      
continue   edit     frame   method  putl  set      tmate   where    

(rdb:1) help next
n[ext][+-]?[ nnn]   step over once or nnn times, 
        '+' forces to move to another line.
        '-' is the opposite of '+' and disables the force_stepping setting.
(rdb:1) help step
s[tep][+-]?[ nnn]   step (into methods) once or nnn times
        '+' forces to move to another line.
        '-' is the opposite of '+' and disables the force_stepping setting.
(rdb:1) 

关于ruby-on-rails - 是否可以逐步完成 RoR 应用程序?或者只使用调试断点进行调试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3963136/

相关文章:

debugging - IBM Worklight - 调试 Worklight 验证器和/或登录模块

iphone - 为联系人设置地址簿图像似乎不起作用

ruby-on-rails - 应该使用自定义关系名称匹配器 has_many

ruby-on-rails - ruby on Rails time_ago_in_words 不显示几秒前

http - Fiddler Web 调试器 - 将“捕获流量”按钮添加到工具栏

html - 媒体查询之一不起作用

html - 即使在汉堡菜单上滚动,我如何防止 body 滚动?

ruby-on-rails - Rails 4.0.1 和 HAML 中的 `undefined method ` [] ' for nil:NilClass`

ruby-on-rails - Rails 模型和 ActiveRecord 中的子类化

ruby-on-rails - 这些错误消息是什么意思?