Ruby debugger fails on STDIN.gets user input

有些话、适合烂在心里 提交于 2019-12-12 08:25:54

问题


I believe you can easily reproduce the issue. Just take a fresh RubyMine (7.1) — either Mac or Windows version, Ruby 2.2, create simple script:

puts "Hi, i'm gonna break your debugger :)"
user_input = gets
puts "Here should be breakpoint"

Put the breakpoint on the 3-rd line and run Debug session (RubyMine uses ruby-debug-ide gem).

When you type something in RubyMine console window for the script to read in gets — program doesn't eat your input saying:

Could not execute statement: current stack frame is unavailable. Pause the process to use console interpreter

What's going on here and how can you debug such Ruby scripts?


回答1:


This appears to be a RubyMine quirk. If you disable the console prompt by clicking on the 'Show Console Prompt' icon in the debug pane this should start working as you expect

See attached Screenshot if you are struggling to find the 'Show Console Prompt'enter image description here



来源:https://stackoverflow.com/questions/31147082/ruby-debugger-fails-on-stdin-gets-user-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!