Options for distribution of an offline Ruby on Rails application
Asked Answered
H

7

19

I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language.

This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but...

My understanding is, that in order to run an instance of this application on somebody else's computer, they would need to install ruby on rails, and a webserver (or webrick, perhaps), as well as my application code.

I am just curious if there are any other options for distributing my application as a standalone app, or perhaps just a simple way to package up a web browser and ROR together with my app for a simple, one-step install?

Hageman answered 11/9, 2008 at 2:40 Comment(0)
B
7

I have personally never needed to do this. But, I have ran across this tutorial http://www.erikveen.dds.nl/distributingrubyapplications/rails.html that I think will be helpful. The tutorial covers how to actually convert a rails app into a standalone exe file.

Bakemeier answered 11/9, 2008 at 2:45 Comment(1)
This looks like exactly what I need, with potentially 2 drawbacks: 1) It is unclear whether clicking on the resultant executable actually launches a webserver, or if not, what it does 2) It doesn't look like you can package the app for cross-platform. Is that the case?Hageman
D
3

Note, Slingshot appears to be a dead project (see comments). I'll leave this answer here for historical purposes and the off-chance that it comes back

Joyent's Slingshot might be a good bet.

Joyent Slingshot allows developers to deploy Rails applications like a standard desktop application, which work online and offline (with synchronization), have drag and drop, and interact with all the other desktop applications.

With Joyent Slingshot:

  • Create a hybrid Web/desktop application
  • Synchronize online and offline data
  • Use the same code for online and offline application(s)
  • Deploy and update your application easily
  • Drag into and out of application

Here are some further links to help with your evaluation and/or to help you get started:

Dacoity answered 11/9, 2008 at 11:42 Comment(2)
Is this still available? I cannot find it anywhere. The links are all dead ends.Wellfound
I can confirm that this project seems to be gone. A fair bit of the wiki and blog posts appear to remain, but I suspect the code is no longer maintained.Bisson
M
2

The way most people ship ruby programs, including Rails webapps, as a standalone exe is via rubyscript2exe. They describe how to package a Rails application at http://www.erikveen.dds.nl/distributingrubyapplications/rails.html. Ruby, Rails, and all the associated libraries will be included in the EXE file.

As others mentioned, Ruby is not necessarily Rails and if you really want an easy way to write a distributable GUI application in Ruby, Shoes is an excellent place to start looking.

Mosier answered 11/9, 2008 at 21:57 Comment(0)
E
1

Gears on Rails maybe?

Enneagon answered 11/9, 2008 at 2:42 Comment(0)
D
1

You can include Ruby on Rails by freezing it to the version of Rails you want to use in your project. They call this Freezing. The user will not have to install Rails to use your application. You can do this with any library you use in your project. If the project uses a library, just place it under the Vendor folder in your project. Then use a tool similar to what @Josh answered with to package it.

You will need a web server to run the project though. There is no way around this. Ruby on Rails is just like ASP.NET in this regard, in that it is a server side framework. The server runs the code and outputs the HTML to the browser by using the Rails framework.

Unfortunately, you may have picked the wrong framework to do what you want. Instead of Ruby on Rails, you may want to check out Shoes, which is a framework for developing GUI applications using Ruby.

Delois answered 11/9, 2008 at 3:4 Comment(0)
H
1

You could always consider compiling your Ruby to JVM byte-code (via JRuby) or .NET byte-code (via IronRuby) to distribute to people who have those virtual machines and don't want to install a Ruby runtime.

You might want to check out Shoes for building desktop applications in Ruby. Rails really is tuned for building websites.

Haveman answered 11/9, 2008 at 13:23 Comment(0)
P
0

You do not specifically say whether it is supposed to be a GUI application or not. From the other answers, I would guess so.

Therefore, you need to clarify what your goals are. RoR is a specialized framework for web applications. If your goal is to learn RoR, I'd say to get yourself some inexpensive web hosting and make yourself an app. If your goal is to learn Ruby, not necessarily Rails, then Shoes, IronRuby, JRuby, MacRuby and others may be good options to look at.

Peraza answered 11/9, 2008 at 13:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.