随应用程序一起分发Ruby吗? [英] Distributing Ruby along with application?

查看:109
本文介绍了随应用程序一起分发Ruby吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的桌面Ruby客户端,我希望将其分发给少数(技术和非技术)人员.

I have a simple desktop Ruby client which I would like to distribute to a small number of (technical and non-technical) people.

客户端将作为守护程序运行,因此没有GUI.我只需要客户端在OSX和Linux上运行即可.

The client will run as a daemon, hence there is no GUI. I only need the client to run on OSX and Linux.

是否可以通过应用程序分发特定版本的Ruby并使用该版本运行客户端?我该怎么办?

Is there a way that I can distribute a certain version of Ruby with the application and run my client using that version? How would I do this?

推荐答案

是的,但是它可能过于复杂. Ruby需要针对正在其上运行的平台进行编译,因此您将需要能够访问要分发到的所有不同平台,然后针对这些平台进行编译,将所有它们都包括在您的发行版中,并在在当前平台上运行,并选择正确的二进制文件.这整个过程过于繁琐且容易出错.此外,这些二进制文件不一定会很小,这会使您的可分发量膨胀.

Yes, but it's probably prohibitively complicated. Ruby needs to be compiled for the platform you're running it on, so you would need to have access to all the different platforms you'd be distributing to and then compile against those, include all of them in your distribution, and detect at runtime the current platform and pick the correct binary. This whole process is excessive and error-prone. Further, these binaries are not necessarily very small, which will bloat your distributable.

所以为什么不将它们指向Windows的 RubyInstaller ,告诉他们已设置为在OS X上运行,通常,Ubuntu用户非常聪明,您可以给他们提供更复杂的说明,或者更好的是,将您的应用程序作为Ubuntu软件包分发,以便将Ruby作为依赖项安装.

So why not just point them to RubyInstaller for Windows, tell them they're set to go on OS X, and Ubuntu users are generally savvy enough that you can give them more complicated instructions, or, better yet, distribute your application as an Ubuntu package so Ruby gets installed as a dependency.

这篇关于随应用程序一起分发Ruby吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆