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

ask() causes Readline-related error on Ruby 3.3 #271

Closed
64kramsystem opened this issue Jun 29, 2024 · 5 comments · Fixed by #272
Closed

ask() causes Readline-related error on Ruby 3.3 #271

64kramsystem opened this issue Jun 29, 2024 · 5 comments · Fixed by #272
Assignees
Labels

Comments

@64kramsystem
Copy link

64kramsystem commented Jun 29, 2024

On Ruby 3.3, ask() causes the following error:

/path/to/gems/ruby-3.3.1/gems/highline-3.0.1/lib/highline/terminal.rb:115:in `readline_read': uninitialized constant HighLine::Terminal::Readline (NameError)

        Readline.completion_proc = lambda do |str|
        ^^^^^^^^
Did you mean?  Reline
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/terminal.rb:100:in `get_line_with_readline'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/terminal.rb:87:in `get_line'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline.rb:541:in `get_line'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline.rb:525:in `get_response_line_mode'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/question.rb:534:in `get_response'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/question.rb:546:in `get_response_or_default'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/question_asker.rb:31:in `ask_once'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline.rb:222:in `ask'

Renaming Readline calls to Reline seems to fix the issue, but I'm not familiar with the codebase.

@abinoam
Copy link
Collaborator

abinoam commented Jul 9, 2024

Thanks for reporting it. I'll take a look at it as soon as possible. I'll keep you informed.

@abinoam abinoam self-assigned this Jul 9, 2024
@abinoam abinoam added the bug label Jul 9, 2024
@abinoam
Copy link
Collaborator

abinoam commented Jul 9, 2024

At Ruby 3.3.0 release note we have:

Stdlib compatibility issues
ext/readline is retired

    We have reline that is pure Ruby implementation compatible with ext/readline API.
    We rely on reline in the future. If you need to use ext/readline,
      you can install ext/readline via rubygems.org with gem install readline-ext.
    We no longer need to install libraries like libreadline or libedit.

abinoam added a commit that referenced this issue Jul 15, 2024
Fix #271 - Readline completely deprecated in Ruby 3.3
@abinoam
Copy link
Collaborator

abinoam commented Jul 15, 2024

Hi @64kramsystem

Fixed and released (see: https://rubygems.org/gems/highline/versions/3.1.0)

Could you confirm it now works ok for you (at version 3.1.0) ?

Thank you for reporting it.

@64kramsystem
Copy link
Author

Hi @64kramsystem

Fixed and released (see: https://rubygems.org/gems/highline/versions/3.1.0)

Could you confirm it now works ok for you (at version 3.1.0) ?

Thank you for reporting it.

Issue fixed. Thanks! 🙏

@abinoam
Copy link
Collaborator

abinoam commented Jul 16, 2024

Thank you again @64kramsystem! 🤜 🤛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants