Around a decade ago I used a script called ruby2exe and diving into that was a truly magical journey of discovery - finding an embedded Pascal compiler was... Interesting.
* Invoke ruby program
* Find all in-memory dependencies
* Statically link ruby and the discovered dependencies
* Compile with an args interface with the Pascal compiler
* Spit out exe