Can ruby scripts be precompiled into a binary?

那年仲夏 提交于 2019-12-22 05:38:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!