Skip to content
New issue

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

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

Already on GitHub? # to your account

IRuby with irb v1.15+ doesn't show output cells #365

Closed
cveneziani opened this issue Feb 11, 2025 · 5 comments
Closed

IRuby with irb v1.15+ doesn't show output cells #365

cveneziani opened this issue Feb 11, 2025 · 5 comments

Comments

@cveneziani
Copy link

Like @hypsakata with irb v1.13.0 (see issue #338 and PR #339), I'm facing a similar issue with irb v1.15+

I have the following output error in my notebook:

NoMethodError: undefined method build_statement' for an instance of IRB::Irb

The build_statement method has been removed with the release of irb v1.15.0
Especially this commit: ruby/irb@9fc14eb

I applied the following patch on my local setup and I got it working:

def eval(code, _store_history)
-  @irb.context.evaluate(@irb.build_statement(code), 0)
+  @irb.context.evaluate(@irb.parse_input(code), 0)
  @irb.context.last_value unless IRuby.silent_assignment && assignment_expression?(code)
end

Applying this patch would break compatibility with prior versions of irb.
Not sure what's the policy of iruby regarding which versions of irb it should be compatible with.

Anyway, hope it helps anyone stuck with the same issue.

@sealocal
Copy link
Contributor

This was fixed in #364, but has not been released to Ruby Gems.

@cveneziani
Copy link
Author

Oh sorry I forgot to check closed PRs. Thanks for the reply. Closing this issue :)

@sealocal
Copy link
Contributor

@kojix2 @mrkn Could someone push a release to RubyGems?

@mrkn
Copy link
Contributor

mrkn commented Feb 13, 2025

@kojix2 Could you please push a new gem?

@kojix2
Copy link
Member

kojix2 commented Feb 13, 2025

Okay. I'll take the time to push the iruby gem to the rubygem server this weekend.

@kojix2 kojix2 mentioned this issue Feb 16, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants