与应用程序一起分发 Ruby?

发布于 2025-01-02 19:05:57 字数 159 浏览 3 评论 0原文

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

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

有没有办法可以将某个版本的 Ruby 与应用程序一起分发并使用该版本运行我的客户端?我该怎么做?

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

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风苍溪 2025-01-09 19:05:57

一半的答案是您不需要将 ruby​​ 分发给 OSX 用户 - ruby​​ 已经安装在 OSX 计算机上。只要您的代码可以在 Ruby 1.8.7 上运行,就可以在 Mac 上使用。

Half an answer is that you don't need to distribute ruby to OSX users - ruby is already installed on OSX machines. As long as your code works with Ruby 1.8.7, you are fine on a Mac.

围归者 2025-01-09 19:05:57

是的,但它可能过于复杂。 Ruby 需要针对运行它的平台进行编译,因此您需要能够访问要分发到的所有不同平台,然后针对这些平台进行编译,将所有这些平台包含在您的分发中,并在以下位置进行检测:运行当前平台并选择正确的二进制文件。整个过程过多且容易出错。此外,这些二进制文件不一定非常小,这会使您的可分发文件变得臃肿。

那么为什么不直接将他们指向 Windows 版的 RubyInstaller,告诉他们他们准备在 OS X 和 Ubuntu 用户上使用通常,您足够聪明,您可以给他们更复杂的说明,或者更好的是,将您的应用程序作为 Ubuntu 包分发,以便 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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文