Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: undefined method `preferred_dialog_height' for Reline:Module (NoMethodError) #637

Closed
bquorning opened this issue Jul 12, 2023 · 3 comments · Fixed by #638
Closed
Labels
bug Something isn't working

Comments

@bquorning
Copy link

Description

When tab-completing (e.g. “StandardErr⇥”) in the most recent version of IRB, I get this exception:

>> StandardError/Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb/input-method.rb:399:in `block in <class:RelineInputMethod>': undefined method `preferred_dialog_height' for Reline:Module (NoMethodError)

      contents = contents.take(Reline.preferred_dialog_height)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:588:in `instance_exec'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:588:in `call'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:623:in `call'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:776:in `update_each_dialog'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:652:in `block in render_dialog'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:650:in `map'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:650:in `render_dialog'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/line_editor.rb:500:in `rerender'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:356:in `block (3 levels) in inner_readline'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:354:in `each'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:354:in `block (2 levels) in inner_readline'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:429:in `block in read_io'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:399:in `loop'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:399:in `read_io'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:352:in `block in inner_readline'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:350:in `loop'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:350:in `inner_readline'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:278:in `block in readmultiline'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `block in with_raw_input'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `raw'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `with_raw_input'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/reline-0.3.6/lib/reline.rb:274:in `readmultiline'
	from /Users/bquorning/.rubies/ruby-3.2.2/lib/ruby/3.2.0/forwardable.rb:240:in `readmultiline'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb/input-method.rb:413:in `gets'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:540:in `block (2 levels) in eval_input'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:764:in `signal_status'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:539:in `block in eval_input'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb/ruby-lex.rb:220:in `readmultiline'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb/ruby-lex.rb:246:in `block in each_top_level_statement'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb/ruby-lex.rb:245:in `loop'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb/ruby-lex.rb:245:in `each_top_level_statement'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:558:in `eval_input'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:494:in `block in run'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:493:in `catch'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:493:in `run'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/lib/irb.rb:416:in `start'
	from /Users/bquorning/.gem/ruby/3.2.2/gems/irb-1.7.2/exe/irb:9:in `<top (required)>'
	from /Users/bquorning/.gem/ruby/3.2.2/bin/irb:25:in `load'
	from /Users/bquorning/.gem/ruby/3.2.2/bin/irb:25:in `<main>'

I tried uninstalling irb:1.7.2 and installing irb:1.7.1 and I could not reproduce the behavior. I think most likely the problem is caused by #632. cc @ima1zumi

Result of irb_info

>> irb_info
Ruby version: 3.2.2
IRB version: irb 1.7.2 (2023-07-12)
InputMethod: RelineInputMethod with Reline 0.3.6
.irbrc path: /Users/bquorning/.irbrc
RUBY_PLATFORM: arm64-darwin22
LANG env: en_US.UTF-8
LC_ALL env: en_US.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

Kitty

Setting Files

Are you using ~/.irbrc and ~/.inputrc?

I use ~/.irbrc, but the exception occurs also if I comment out that entire file.

@ghost
Copy link

ghost commented Jul 12, 2023

This also just happened to me.

Just yesterday I updated to irb 1.7.2

Ruby version 3.2.2

I hit tab to autocomplete my variable and then this happened

stacktrace [beeburrt@localhost ch04]$ irb irb(main):001:0> queue = [] => [] irb(main):002:0> queue/home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb/input-method.rb:399:in `block in ': undefined method `preferred_dialog_height' for Reline:Module (NoMethodError)
  contents = contents.take(Reline.preferred_dialog_height)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:588:in `instance_exec'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:588:in `call'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:623:in `call'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:776:in `update_each_dialog'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:652:in `block in render_dialog'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:650:in `map'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:650:in `render_dialog'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/line_editor.rb:500:in `rerender'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:356:in `block (3 levels) in inner_readline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:354:in `each'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:354:in `block (2 levels) in inner_readline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:429:in `block in read_io'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:399:in `loop'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:399:in `read_io'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:352:in `block in inner_readline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:350:in `loop'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:350:in `inner_readline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:278:in `block in readmultiline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `block in with_raw_input'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `raw'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `with_raw_input'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/reline-0.3.6/lib/reline.rb:274:in `readmultiline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/3.2.0/forwardable.rb:240:in `readmultiline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb/input-method.rb:413:in `gets'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:540:in `block (2 levels) in eval_input'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:764:in `signal_status'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:539:in `block in eval_input'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb/ruby-lex.rb:220:in `readmultiline'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb/ruby-lex.rb:246:in `block in each_top_level_statement'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb/ruby-lex.rb:245:in `loop'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb/ruby-lex.rb:245:in `each_top_level_statement'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:558:in `eval_input'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:494:in `block in run'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:493:in `catch'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:493:in `run'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/lib/irb.rb:416:in `start'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.7.2/exe/irb:9:in `<top (required)>'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/bin/irb:25:in `load'
from /home/beeburrt/.asdf/installs/ruby/3.2.2/bin/irb:25:in `<main>'

[beeburrt@localhost ch04]$

@st0012
Copy link
Member

st0012 commented Jul 12, 2023

Sorry about it. I've opened #638 to address the issue.

@st0012 st0012 added the bug Something isn't working label Jul 12, 2023
@ima1zumi
Copy link
Member

IRB 1.7.3 has been released with a fix for this issue. Thank you for your report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants