在 OSX .app 容器中分发 Rails 应用程序

发布于 2024-08-17 16:56:53 字数 392 浏览 2 评论 0原文

我想在 .app 包中分发 Rails 应用程序,以便它可以在 10.4 到 10.6 之间运行;有没有关于如何做到这一点的任何方法或提示?尤其是以下事情让我绞尽脑汁:

  1. 我想用 Ruby 1.8.6 重新打包应用程序,这样即使系统上安装了旧版本的 Ruby(例如 Mac 中的 1.8.4),它也能运行OS X Tiger) - 我将如何解决通用二进制问题?我可以只添加 Ruby 并使用这个特定的 Ruby 版本来运行我的应用程序吗?

  2. 实现:我想要一个 .app 在应用程序启动时启动瘦或混合,并在应用程序关闭时停止应用程序。是否有任何示例 OS X XCode 项目(或任何其他示例)?

  3. XCode 容器是正确的选择吗?我还有哪些其他选择?

I want to distribute a Rails application within a .app package, so it can run from 10.4 to 10.6; is there any howto or hint on how to do that? Especially the following things make me twist my head:

  1. I want to repackage the app with Ruby 1.8.6, so it would run even if there is an older version of Ruby installed on the system (such as 1.8.4 in Mac OS X Tiger) - how would I come around the universal binary problems? Can I just add Ruby and use this specific Ruby version to run my app?

  2. IMPLEMENTATION: I want to have a .app that starts thin or mongrel when the app is started and stops the app when it is closed. Is there any example OS X XCode project out there (or any other example)?

  3. Is an XCode container the way to go? What are the other options I have?

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

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

发布评论

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

评论(4

享受孤独 2024-08-24 16:56:54

如何在您的应用程序中使用 jRuby ,然后您可以将整个应用程序打包为单个 .jar 文件并分发它那样。

除了使用纯 java JDBC 实现更改本机 MySQL 驱动程序之外,我已经能够在 jRuby 中运行 Ruby on Rails 应用程序,而无需对应用程序进行任何重大修改。

另请查看此 类似的问题Kenai项目了解有关jRuby的更多信息。

How about using jRuby for your application, you could then package your whole application as a single .jar file and distribute it that way.

I've been able to run my Ruby on Rails appliations in jRuby without any major modifications to the application besides changing the native MySQL driver with a pure java JDBC implementation.

Also check out this similar question and the Kenai project for more information about jRuby.

一个人的夜不怕黑 2024-08-24 16:56:54

MacRuby 人们可能有一些想法

The MacRuby people might have some ideas

魂牵梦绕锁你心扉 2024-08-24 16:56:54

在 MacRuby 中运行 Rails 应用程序似乎只是时间问题。使用 v0.5b2 它已经支持 Sinatra、Racks、RDoc和其他人。
如果你可以等待(或者将你的 Rails 应用程序移植到 Sinatra),我会选择 MacRuby,

否则我想你可以用 Objective-C 编写一个工具,通过一些终端命令运行嵌入式 Rails 应用程序。 您可以在此处找到一些指示。

It seems to be only a matter of time before you will be able to run Rails apps in MacRuby. With v0.5b2 it already supports Sinatra, Racks, RDoc and others.
I would go for MacRuby if you can wait (or port your Rails app to Sinatra)

Otherwise I guess you could write a tool in Objective-C that runs an embedded Rails App via some terminal commands. You can find some pointers here.

尛丟丟 2024-08-24 16:56:54

你试过板条箱吗?实际上,它是一个用于打包通用 ruby​​ 应用程序的工具,但您也许可以将 Rails 应用程序粘贴到其中。
几个链接:

http://rubyconf2008.confreaks.com/crate -packaging-your-ruby-application.html
http://www.copiousfreetime。 org/articles/2008/11/30/package-an-application-with-crate.html

Have you tried Crate? Actually it's a tool for packaging a generic ruby app, but you might be able to stick a rails app into there.
A couple of links:

http://rubyconf2008.confreaks.com/crate-packaging-your-ruby-application.html
http://www.copiousfreetime.org/articles/2008/11/30/package-an-application-with-crate.html

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