14

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?

aristofun
  • 375
  • 3
  • 18
  • Well, for starters, that script doesn't parse because you're enclosing your string with single quotes and using a single quote in the middle of the string. – Chris Heald Jun 30 '15 at 22:26
  • Oops, sorry. Fixed that. – aristofun Jul 01 '15 at 19:49
  • perhaps it's breaking on the wrong line on accident somehow? like...off by one. Anyway it appears it's executing your string as a debugger statement... – rogerdpack Jul 02 '15 at 03:30
  • it's just an example code, I tested a couple of scripts both on Win and Mac OS after narrowd the problem to "STDIN.gets" — until ruby meet this line debugging works perfect. No matter what line user inputs. – aristofun Jul 02 '15 at 07:19

1 Answers1

35

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

E. Nwofor
  • 9
  • 1
  • 4
ajsrn
  • 366
  • 3
  • 2