Skip to content

Single Ruby File #10

Answered by Hadeweka
mgomes asked this question in Q&A
Sep 7, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mgomes
Comment options

Answer selected by mgomes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants