如何在 Ruby 2.0 中使用调试器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15200165/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use the debugger with Ruby 2.0?
提问by Intrepidd
I know the debugger gem is not and never will be compatible with ruby 2.0 per "officially support ruby 2.X".
我知道调试器 gem 不是也永远不会与“正式支持 ruby 2.X”的ruby 2.0 兼容。
In the changelog of Ruby 2.0 is:
在 Ruby 2.0 的更新日志中是:
Debug support
DTrace support, which enables run-time diagnosis in
production TracePoint, which is an improved tracing API
调试支持
DTrace 支持,可在
生产 TracePoint,这是一个改进的跟踪 API
Is there something out of the box for debugging with Ruby 2.0? Can somebody explain this to me?
是否有开箱即用的 Ruby 2.0 调试功能?有人可以向我解释一下吗?
回答by Alain Beauvois
回答by Intrepidd
Version 1.4.0 of the debugger gem now installs without problems. There are still some issues but this should be fixed soon.
现在安装调试器 gem 的 1.4.0 版没有问题。仍然存在一些问题,但这应该很快得到解决。
The debugger gem does not play well with Ruby 2. Instead, install the Byebug gem that is fully compatible with Ruby 2.
调试器 gem 不能很好地与 Ruby 2 配合使用。相反,请安装与 Ruby 2 完全兼容的 Byebug gem。
回答by Kevin Suttle
Use pry:
使用撬:
gem install pry
gem install pry-debugger
See "Debugging Ruby With Pry".
请参阅“使用 Pry 调试 Ruby”。

