deivid-rodriguez / byebug

Debugging in Ruby 2
BSD 2-Clause "Simplified" License
3.34k stars 328 forks source link

Regression in 11.1.2: ArgumentError: argument must respond to `call' #673

Closed josh-m-sharpe closed 4 years ago

josh-m-sharpe commented 4 years ago

Problem description

Using the latest version 11.1.2, byebug is exiting the debugger after a moment and raising the error: ArgumentError: argument must respond to `call'

You can't see it, in the below copy/paste, but it does drop to a (byebug) debugger for a split second before throwing this argument error.

Reverting to 11.1.1 fixes the issue

Using ruby 2.6.6

[2] pry(main)> reload! ; e = Event.last ; e.foo

[37, 44] in /Users/jsharpe/project/server/app/models/event.rb
   37:
   38:   def foo
   39:     byebug
=> 40:     puts 123
   41:   end
   42:
ArgumentError: argument must respond to `call'
from /Users/jsharpe/.rvm/gems/ruby-2.6.6@project/gems/rb-readline-0.5.5/lib/readline.rb:93:in 
`completion_proc='
[3] pry(main)>

Expected behavior

no error

Actual behavior

see above

Steps to reproduce the problem

install 11.1.2 and use byebug

deivid-rodriguez commented 4 years ago

My bad :pray:, I'll fix it shortly.

I'm curious where this is coming from though. Could you run set stack_on_error and then force the error to occur and copy the stacktrace here?

Thanks!

josh-m-sharpe commented 4 years ago

Sure, how do I do that? I usually just drop byebug into my codez. I'm not a fancy byebug user.

deivid-rodriguez commented 4 years ago

Oh, sorry, I missed that you can't even get to the byebug prompt at all :grimacing:.

Then do this. Create a .byebugrc file in your HOME directory with the following content

set stack_on_error

Then run your code and post the error here.

josh-m-sharpe commented 4 years ago

That doesn't appear to change much:

$ cat ~/.byebugrc
set stack_on_error

$ rc
Loading development environment (Rails 6.0.2.2)
[
1] pry(main)> Event.last.foo

[15, 24] in /Users/jsharpe/project/app/models/event.rb
   15:     )
   16:   end
   17:
   18:   def foo
   19:     byebug
=> 20:     puts 123
   21:   end
   22:
ArgumentError: argument must respond to `call'
from /Users/jsharpe/.rvm/gems/ruby-2.6.6@project/gems/rb-readline-0.5.5/lib/readline.rb:93:in `completion_proc='
[2] pry(main)>
deivid-rodriguez commented 4 years ago

Interesting. Can you instead put the file in your current working directory?

ignatiusreza commented 4 years ago

not sure if it would help.. I'm having the same error, but with a longer stack trace..

ArgumentError:
  argument must respond to `call'
# /path/to/ruby/gems/rb-readline-0.5.5/lib/readline.rb:93:in `completion_proc='
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/interfaces/local_interface.rb:56:in `without_readline_completion'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/interfaces/local_interface.rb:24:in `block in readline'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/interfaces/local_interface.rb:36:in `with_repl_like_sigint'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/interfaces/local_interface.rb:24:in `readline'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/interface.rb:71:in `prepare_input'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/interface.rb:55:in `read_input'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/interface.rb:38:in `read_command'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/processors/command_processor.rb:128:in `repl'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/processors/command_processor.rb:97:in `process_commands'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/processors/command_processor.rb:55:in `at_line'
# /path/to/ruby/gems/byebug-11.1.2/lib/byebug/context.rb:98:in `at_line'
deivid-rodriguez commented 4 years ago

Yeah, it helps. I'll fix shortly and release 1.11.3.

josh-m-sharpe commented 4 years ago

👍 seems resolved. thank you!

deivid-rodriguez commented 4 years ago

No problem, thanks for reporting!