views:

154

answers:

4

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?

+1  A: 

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.

Wolfgang
thanks for your comment. i would like a solution that would work without using external things i don't know so much about - i have no clue about java and it would be rather hard for me to get my head around all this.
z3cko
A: 

The MacRuby people might have some ideas

RyanWilcox
is there an existing solution with macruby to package rails .apps? or what do you mean?
z3cko
Maybe. I'm just saying that if you're not finding help here, maybe the MacRuby mailing list would be a place to get help. If anyone has one I bet they would.
RyanWilcox
A: 

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.

Nino
porting the rails app to sinatra is not an option for me, since the app is too big (3 yrs of development) - what is the current status of rails apps in macruby? do you have any pointers?and for the objective-c hint: didn't they have a .app container in instiki?
z3cko
Rails support in MacRuby will probably take a while, and if your app depends on a lot of gems, that could take even longer.So that leaves you with option 2 for now. I would build a really simple implementation and try it out on a few different machines. It will probably help if you could narrow down your requirements to only include 10.5 and up.
Nino
A: 

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

neutrino