-
Hello, The README mentions a current limitation is that only a single Ruby file can be run. Does this apply to mruby files too? Is there an expectation this limitation an ever be eliminated? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The limitation does not apply to mruby. And even for regular Ruby there are some ways to bypass the problem. This does not solve every possible use case, but might at least provide some ideas. Regarding a general solution to the problem: Without the guard provided by Anyolite, executing multiple Ruby files leads to a segfault, but I am not yet fully sure why. In a bit more detail: It crashes when trying to compile the script to bytecode using the The Ruby documentation is sadly very unhelpful, and the scenario of embedding the regular Ruby interpreter to execute multiple files at once very rare, so I am not sure how to fix this problem. |
Beta Was this translation helpful? Give feedback.
The limitation does not apply to mruby.
And even for regular Ruby there are some ways to bypass the problem.
Contrary to mruby, you can use "require" in your Ruby scripts, so you can load all your needed classes in before.
You are also able to execute single script lines at any time before or after loading the main file.
This does not solve every possible use case, but might at least provide some ideas.
Regarding a general solution to the problem: Without the guard provided by Anyolite, executing multiple Ruby files leads to a segfault, but I am not yet fully sure why.
In a bit more detail: It crashes when trying to compile the script to bytecode using the
ruby_options
function a second t…