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

ruby: (some) builtin functions not available with ruby 3.3 #2109

Open
u3shit opened this issue Apr 30, 2024 · 1 comment
Open

ruby: (some) builtin functions not available with ruby 3.3 #2109

u3shit opened this issue Apr 30, 2024 · 1 comment
Labels
bug Unexpected problem or unintended behavior

Comments

@u3shit
Copy link

u3shit commented Apr 30, 2024

Describe the bug

Upgrading my ruby from 3.1 to 3.3.1, my very simple script stopped working because it couldn't find Kernel.loop. (But it's also easily reproducible from /ruby eval).

Steps to reproduce

  1. /ruby eval [].shuffle or /ruby eval loop { break } or call any other function defined in .rbinc files.

Current behavior

21:51:28 =!= | ruby: error: (eval at (eval at eval:34):7):1:in `script_ruby_eval': undefined method `shuffle' for an instance of Array (#<Class:#<NoMethodError:0x00007f4b6cdd6d78>>)
21:51:28 =!= | ruby: error:      from (eval at eval:34):7:in `module_eval'
21:51:28 =!= | ruby: error:      from (eval at eval:34):7:in `script_ruby_eval'

Expected behavior

Built-in ruby functions work...

Suggested solutions

No response

Additional information

No response

WeeChat version

4.2.2

What OS are you using?

Gentoo

On which terminal are you running WeeChat?

No response

Which terminal multiplexer are you using?

No response

@u3shit u3shit added the bug Unexpected problem or unintended behavior label Apr 30, 2024
@u3shit
Copy link
Author

u3shit commented Apr 30, 2024

Looks like ruby_process_options need to be called now, it calls a bunch of (private) setup functions, something sets up these builtin methods. As a very quick and dirty workaround, adding

char* dummy_argv[] = { "ruby", "-enil", NULL };
ruby_process_options(2, dummy_argv);

after ruby_init seemingly fixes the problem... But some MRI wizard can probably come up with a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant