0

I'm using rails-pry to create a breakpoint with a binding.pry statement. This has worked just fine for just about ever. However now there's this fun new error message I'm not even sure how to being debugging the debugger:

before_session hook failed: NoMethodError: undefined method `chomp' for nil:NilClass
usr/local/bundle/gems/pry-0.12.2/lib/pry/pager.rb:116:in `block in write'
(see _pry_.hooks.errors to debug)

The result is the binding.pry statement is ignored and the code I intent to inspect continues to run.

Dylan Pierce
  • 4,313
  • 3
  • 35
  • 45
  • 1
    Can you post a self-contained example ruby script that exhibits the behavior? If you run `Readline.readline("")` in an irb console does it work? https://github.com/pry/pry/blob/v0.12.2/lib/pry/pager.rb#L116 – spike Feb 15 '19 at 16:19
  • According to the doc, Readline.readline method returns `nil` when you have empty line and enter `EOF` (Ctrl-D), so maybe you are sending Ctrl-D accidentally. And other than @spike's suggestion I would try to see if you haven't upgraded ruby or your OS recently, since Readline is a module which interfaces to the GNU readline. – Viktor Nonov Feb 15 '19 at 17:30

0 Answers0