views:

580

answers:

8

I would like to distribute a rails application as a double clickable application. When someone double clicks on the app, I think that mongrel should be started and then the user's browser should be started and open to something like localhost:3000 I'm trying to work through what I will need to do this, I think I'm going to need to include a copy of rails in the project, and a copy of the gems. Do I need to distribute ruby? Initially I'm looking to target the mac and linux for distribution. Does anyone have any experience packaging rails application like this?

The Application I'd like deploy is a media center server for a user's media. Unfortunately this means I can't have a public server serving out the media. I've built up the server using ruby on rails and rake tasks to import and manage the media. Is there a good way to make this easy for users to install? The idea was with a double clickable application it would be easy for users to bring up and down the server.

+1  A: 

The ill-fated Joyent Slingshot did exactly that, it allowed you to embed your Rails application as a standalone executable under Windows and Mac. It even provided a simple but straightforward method to allow data synchronization with an online version. Alas, it hasn't seen any activity in a long time.

https://dev.joyent.com/projects/slingshot/wiki/Slingshot

pantulis
This looks like exactly what I'm looking for but it hasn't been updated for more than a year. :( Have you heard of any replacement for it? I wonder how hard it would be to swap in newer versions of rails and the other assets that it contains. It is open source...
nixterrimus
In theory it shouldn't be that hard, at least on OSX --it embedded its own Ruby interpreter and its own Gem repository.
pantulis
I saw that, pantulis, I'm curious if they made changes to the stock ruby interpreter. It looks like from some of their commit messages that there was some interesting tweaking going on to create their "VM".
nixterrimus
+1  A: 

Spiceworks is a desktop-deployed Rails app, or at least it was a couple of years ago. It's a free (ad-supported) download.

aem
Looks like an interesting app, which they had more information on how they were accomplishing the local app setup.
nixterrimus
+5  A: 

If you want to write desktop apps, write desktop apps, if you want to write web apps, write web apps.

railsninja
I think that in most cases you are absolutely right, but I think my case may be unique and I'd like to fly it by you. I'm building an application that serves media out across a user's local network via a web server. So the user can come and listen to their music right in their browser. I want to make it as easy to install and use as possible so the idea was to have a double clickable application which launches their media server for their network. Does this make sense for having a web app launch as a desktop app? Can you think of a better approach for this?
nixterrimus
@nixterrimus: Cool idea, and I see where you're going with it, but I'm going to have to agree with @railsninja here: I don't think trying to turn a Rails application into a desktop application is the way to go with this. I'd personally go with a desktop-oriented programming environment like C# instead, but you can still write your application with Ruby and compile it into an executable (I know there are Python compilers like this around, but I don't know about Ruby, so you're on your own). Just write a small wrapper around Mongrell or whatever server you happen to want to use.
musicfreak
I'm not saying don't use Ruby, you certainly can use it for a desktop app, but Rails as a desktop app is really square peg round hole situation.
railsninja
A: 

Hey, take a look at shopify and their theme designer app. http://vision.shopify.com/ Is pretty much exactly what your talking about. All they have done is written a stub for both platforms that launches the rails project. You can take a look at the code that checks for the rails project browsing through the vision app package contents.

ADAM
This kind of thing is really written for developers. Can you imagine trying to walk users through an Apache/nginx + passenger install or worse helping them monitor their mongrel instance? No Thanks.
railsninja
+3  A: 

I've decided to use jruby and look into packaging the application as a java app.

nixterrimus
If you are going to package it up that is a pretty decent way to go. I still think you are shoehorning a bit, but at least you are giving it some thought. I hope it goes well.
railsninja
Thanks, railsninja, I think it's the most stable way to distribute it. I really appreciate all of your help and incite.
nixterrimus
A: 

I agree with the previous posters regarding desktop apps but I find myself writing web apps for the desktop (mostly widgets using Fluid) so I understand the issue. Has anyone had a look at Titanium Desktop from Appcelerator (http://www.appcelerator.com/)? I tried it initially and there was a little fiddling required, but the end result was more or less a desktop app.

Sven Schott
Looks interesting but it's a different direction than I'm going. The app I'm working on let's users serve out media across their network so the app needs to run local and have access to local (but very limited) resources. Thanks for the heads up on this, though, I may have a need in the future.
nixterrimus
A: 

In the future, I think MacRuby will provide an excellent way to run web-apps on the desktop (well I mean OS X desktop) - you could in theory, spin up a Rails app and then have a WebView point to the Rails app. Currently, they're still focusing on making MacRuby a first-class citizen of the OS X ecosystem but Rails support is on the roadmap.

MacRuby is also exciting because of the work on the AOT compiler, with which you can compile Ruby code to machine code.

Arun
I look forward to that day when macruby can wrap up a rails application. I would love to target just the mac for my releases but I'm sure that's reasonable right now.
nixterrimus
+1  A: 

Appcelerator Titanium natively supports building client-based/desktop applications using Ruby.

jhaynie