Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在稍后使用线程调用的 proc 中使用 byebug/debugger,但它不起作用。那么如何在 proc 中调试代码呢?
您必须确保在其中添加断点的线程最终会调用join.
join
例如:
myproc = Proc.new do Thread.new do require 'pry'; binding.pry end.join end myproc.call
将在断点处停止。
然而
myproc = Proc.new do Thread.new do require 'pry'; binding.pry end end myproc.call
将不会