Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Rails as a desktop application

I just start RoR development for two weeks, It's pretty amazing programming language so far. It's impressing me so much so that I'm start to thinking about change the programming language of my client's project from PHP to RoR. But what I want to know is, is it possible to make a RoR web app looks like a Native App when using it in a local machine. By the term of Native app I mean ..

  1. The user doesn't have to run script/server or rails server every time they starts their machine
  2. Either access it by Web Browser or something else is fine.
  3. Can be running with Window 7 or Window XP

Other recommendation are welcome. (Including, the reason not to use RoR to develop a local application)

like image 800
Tar_Tw45 Avatar asked Dec 06 '22 18:12

Tar_Tw45


2 Answers

I personally don't think there's anything ridiculous with wanting to deploy a Rails app as a desktop application but it's certainly not the easiest thing to do. Heres a list of what you're going to need:

  • a compiled distributable ruby interpreter
  • a distributable database
  • a script to bootstrap the whole thing( preferably that runs on the click of an icon or when system starts)
  • an installer

optionally:

  • write a simple shell in qt or java(possibly with the ruby bindings even) that handled starting and stopping the rails app, and provided a webframe for your customer to use instead of the standard web browser.

Here's a tutorial on deploying a rails app as a desktop app, though for debian, that should start you in the right direction. But your best bet for a quick gui application in ruby is shoes.

like image 56
greggreg Avatar answered Dec 21 '22 06:12

greggreg


since rails is framework for web development there is no way to avoid starting rails server to show something on local machine. you might hide the fact that server is being started by running it as service without letting the user know about it but that's only as far as you can get.

so yes, it is possible to bundle your application into a "native app" but i'm afraid it will be extremely fragile as there are too many pieces that need to fit together: ruby itself, database to use, rails and all the other gems. big chance is you will have a gem that needs to be compiled and then you're in trouble.

bottom line: it's not worth it, either host your app or pick a better solution to develop something that runs only locally.

like image 41
keymone Avatar answered Dec 21 '22 07:12

keymone