问题
I'm working on a Ruby script that will need to be deployed onto systems without a ruby interpreter. It will need to run on FreeBSD systems which uses the ELF format.
I know there is a ruby2exe project to compile ruby scripts to run on Windows, but is it easy or even possible to do that on other operating systems?
回答1:
Have you checked whether Rubinius or JRuby would allow you to precompile your code?
回答2:
Aside from bytecode that requires a VM to run, Ruby cannot be compiled. It is an interpreted langauge and as such requires an interpreter. ruby2exe packages a ruby interpreter and runtime library with your application.
来源:https://stackoverflow.com/questions/5654335/can-ruby-scripts-be-precompiled-into-a-binary