问题描述
我是红宝石编程的新手,实际上写了一个我想做的程序
分发给装有Windows计算机且未安装红宝石的人.我听到了有关exerb的一些信息,但是我不确定这是否适合我的问题,或者是否更容易解决.我可以使用某些东西来使我的ruby代码像exe文件一样运行吗?
Im new to programming in ruby and actually wrote an program that I would like to
distribute to people that have windows computers and no ruby installed. I heard something about exerb but I'm not sure if this is the right thing for my issues or if there is something easier. Is there something I can use so that my ruby code can be run like an exe file?
推荐答案
您可以使用 ocra 创建一个exe文件.
You can use ocra to create an exe.
这个exe文件是一个自解压缩的ruby解释器,带有您的代码.
This exe-file is a self-extracting ruby interpreter with you code.
安装ocra之后,您可以开始:
After installing ocra, you can start:
ocra my_application.rb
有一些限制/陷阱:
- 您可能不依赖其他dll(例如,参见将RMagick与Ocra捆绑)
- 无条件要求(所有软件包必须在最初的ocra调用中调用.)
- You may not depend on additional dll (see e.g. Bundling RMagick with Ocra )
- No conditioned requires (all packages must be called by the initial ocra call.).
您可以检查标记为 ocra 的问题,以了解有关ocra的一些详细信息.
You can check questions tagged ocra to see some details about ocra.
这篇关于在未安装ruby的计算机上运行ruby程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!