Deploying Rails as a desktop application
Asked Answered
T

6

5

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)

Topic answered 28/11, 2011 at 11:8 Comment(1)
Thanks everyone for your comment. I'm really appreciate : )Topic
R
2

Maybe out of topic, but if you want to make native application, perhaps make native application? I mean, what's the purpose to develop a web application and then host it locally?

At least, you could consider using free hosts, such as heroku. http://your-project-name.heroku.com will grant you a 5mb database and 1 worker. It's free, will save you a lot of troubles and will make it easier for you to deploy newer version to your clients.

Just have them put a bookmark on their desktop if they want to double click to open application.

Redingote answered 28/11, 2011 at 14:51 Comment(2)
Thanks, I'm thinking about Heroku too. But the only problem that I'm concern is, he have to wait for a few seconds each time he input the new order which he have several orders everyday. One good thing about web application is it can be access anywhere. I can rent a server for him from somewhere, register for a domain name, and then host the app. I hope that he might be happy with this and forget the few seconds delay problem. Also I might tell him that if he want a front-end for his clients soon, web application will be perfect plan for him. Even though, he wants only CRM system for now.Topic
Using web development to create native applications has plenty of benefits and isnt all that absurd. Especially when you consider all the hybrid apps out there. Its an easy way to get something done without learning new technology and is cross platformAerostatics
S
5

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.

Semimonthly answered 28/11, 2011 at 18:51 Comment(3)
Server-side Web applications and desktop applications work differently. It may be nice to develop both from the same codebase, but deploying one as the other kind of sucks, because it doesn't really take advantage of the special features of the platform.Rosiarosicrucian
@MarnenLaibow-Koser I totally agree. But I don't think it's ridiculous, and in getting it done there is a lot to learn.Semimonthly
Greg: It's ridiculous because it puts the application in a place where it won't run well -- while writing an application that will run there isn't really any harder. There's a lot to learn, but the idea is not generally useful.Rosiarosicrucian
C
3

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.

Capsular answered 28/11, 2011 at 11:17 Comment(1)
Thanks for your comment. I'm seeing the whole picture more clearly. : )Topic
L
2

Maybe I am wrong but you seem to miss the fact that RoR is not a programming language. Ruby is a programming language and RoR is web-development framework. Anyway if you want to develop desktop applications, you can use Ruby with a framework such as Bowline (to keep the MVC spirit).

Lusty answered 28/11, 2011 at 11:26 Comment(0)
R
2

Maybe out of topic, but if you want to make native application, perhaps make native application? I mean, what's the purpose to develop a web application and then host it locally?

At least, you could consider using free hosts, such as heroku. http://your-project-name.heroku.com will grant you a 5mb database and 1 worker. It's free, will save you a lot of troubles and will make it easier for you to deploy newer version to your clients.

Just have them put a bookmark on their desktop if they want to double click to open application.

Redingote answered 28/11, 2011 at 14:51 Comment(2)
Thanks, I'm thinking about Heroku too. But the only problem that I'm concern is, he have to wait for a few seconds each time he input the new order which he have several orders everyday. One good thing about web application is it can be access anywhere. I can rent a server for him from somewhere, register for a domain name, and then host the app. I hope that he might be happy with this and forget the few seconds delay problem. Also I might tell him that if he want a front-end for his clients soon, web application will be perfect plan for him. Even though, he wants only CRM system for now.Topic
Using web development to create native applications has plenty of benefits and isnt all that absurd. Especially when you consider all the hybrid apps out there. Its an easy way to get something done without learning new technology and is cross platformAerostatics
R
2

If you want a Web application, build a Web application. If you want to build a desktop application, try Monkeybars or Appcelerator.

Rosiarosicrucian answered 28/11, 2011 at 18:25 Comment(0)
G
1

Quite late for my answer but anyway I had the same problem and use the gem ocra to build an exe for windows. It is also possible to generate a setup to install the program in the register.

It is still necessary to have a server started but the user has just to click on the exe program; A console is opened and give some instructions like 'after the start of the server, open a browser and go to localhost:3000; Ctrl + C to exit when you have finished.

It could be possible to have the server launched as a service but I think my users prefer to know if the program is running or not.

ocra is not really easy to set but eventually it works fine.

Goatskin answered 27/1, 2013 at 15:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.