How do I package a rails as a standalone executable - ruby-on-rails

I've been developing a web application and a lot of customers are asking if they can host the application in their network (for security reasons). I have been looking for a way to package up a rails app into a single executable (with server and all), but haven't been able to find anything. My other requirement is that we distribute it without the source. Because of that I was looking at JRuby and Warbler. The end product should run on linux or windows. Has anyone done anything like this before, or can anyone point me in the right direction.
Thanks

My best guess would be to use JRuby and the JRubyCompiler, although I have no idea if you could compile a whole rails project (including all the required gems). I got it to compile a small ruby script though. Anyway, if you succeed, you could package those in a jar or war and deploy that as a contained application.

It doesn't sound like you necessarily need to package it as an executable, as long as the code is obfuscated. I personally haven't needed to protect any of my code, but a quick google search returned this product http://rubyencoder.com/. I'm sure there are others out there, but the basic idea is that your code is unreadable and cannot be reverse engineered. This would allow you to run a standard rails environment without giving access to your source code.

If you have the budget and really want to outsource this, the Github guys partnered with BitRock to build their cross-platform installable product (Github Firewall Install). BitRock has this case study on their website.

Related

How do I develop self-hosted Rails app

Suppose I have Rails 4 app, call it "Super SaaS". Now my client says he likes my appvery much, but he doesn't want his data to be in the cloud. So he says he would buy a licience from me to deploy "Super SaaS" on his own server. More like Atlassian Jira.
The question is: is there any secure way(in terms of protecting source code) to do that?
While you can probably package up your code as a JRuby application with JAR files and Java byte code, there are decompilers for that, so you can never presume your source to be 100% secure.
Ideally you'd offer some sort of VM appliance that the customer can install, a system image compatible with VMWare or whatever virtualization system they're using. This helps package up a fairly secure environment, but won't protect against a determined adversary trying to get your source code.
If you're giving out your code to someone in any form, compiled or otherwise, you have to have a certain amount of trust. Even compiled executables are not immune to reverse-engineering.

Best way to deploy (J)Ruby application alongside multiple html5/gwt games built with Libgdx

I have been learning about the libgdx framework, and I am completely in love with it. My associates and I have been developing several games over the last few months and are starting to think about deployment.
We've ironed out most of the wrinkles with our android and iOS builds. Now we are thinking about the gwt builds. I've built a small Ruby on Rails (MRI... for now) website where we'd like to host the GWT version of these games.
By default libgdx produces a .war package. I've done some research and it seems totally possible and normal to deploy multiple wars to the same application server. This is good, because I think it would be overkill to have a dedicated app server for each tiny gwt game. Then with Warbler, it seems I could package my RoR app to also be a war. Problem solved. Nice and Neat.
I'm really just wondering if this is the simplest way to go. I'm not super familiar with GWT, but it seems that the end product is just javascript (with perhaps many dependent assets...). Would it be simpler to extract the js from the war package, perhaps upload them to s3 or something similar, and just have my (already built and deployed) MRI RoR app serve them out like it would any other page?
I would really appreciate the insight of those with more experience than I.
Thanks a lot, and if you would like any more information about the problem, please comment and I will edit the question appropriately.
Edit:
Sorry, upon further reflection, I suppose my question boils down to this. Which is the wiser path? 1) convert my existing rails app and infrastructure to run a war package so that the games (currently in war packages) and the webapp will run neatly alongside each other. 2) extract the js and assets from the war package and have them run neatly alongside my existing MRI rails app.

How to have much lighter version of Spring Source Tool Suite?

STS is over 350MB and most of it is corporate blubber ware that I do not need. For example its default installation includes bunch of Servers that shows up in project explorer and other things related to VMware cloud related products. All I need is Grails and Groovy and JavaScript related development and nothing else.
What is the procedure to remove all these things for clean and light installation of STS without destabilizing STS?
You can choose not to install tc server, Spring Roo and Apache Maven during the install. Also, you can go under Help -> About SpringSource Tool Suite, click Installation Details..., and uninstall plugins you don't want.
I know this question is already answered, but I just wanted to mention another way of installiong STS. You can do this through update sites. This way is slightly more complicated (only slightly), but does have the smallest footprint. You can see the instructions here:
http://blog.springsource.com/2011/03/25/early-access-springsource-tool-suite-for-eclipse-indigo-3-7/

How can I create an all-in-one installer for Ruby on Rails application deployment on Windows?

I'm in the process of deploying a rails application to Windows machines. I do all of my development with OS X and Linux, but the final app will actually run on Windows machines.
That said, my client is looking for an all-in-one Apache(I had to talk him out of IIS)+Rails+Application deployment/installer. He wants to hand all of his (Windows-based) clients an install CD for their respective servers (they all want their own setup).
Is there anything like this in existence? I realize Capistrano exists but that requires a great deal of setup on the hosts (especially for Windows) beforehand and it's not very feasible in this particular case.
In the past I've used InnoSetup (http://www.jrsoftware.org/isinfo.php) for creating installers, but I'm not sure that's going to work in this case.
If you guys have any input, suggestions, or highly persuasive client techniques (to talk them all out of Windows =P) it would be most appreciated.
Best.
Try with RubyStack:
BitNami RubyStack is an installer that greatly simplifies the installation of Ruby on Rails and its runtime dependencies. It includes ready-to-run versions of Ruby, Rails, MySQL and Subversion as well as a number of third-party libraries like FiveRuns TuneUp. RubyStack is distributed for free under the Apache 2.0 license and has been packaged using BitRock's multiplatform installer.
http://bitnami.org/stack/rubystack
I'd look into using jruby with glassfish. Make sure the users have java and it should be good to go.
RubyStack is the closest thing to what you're after, although you might need to tailer the install a bit and remove some unwanted baggage. I don't know of any other Windows projects for a production environment (InstantRails is designed for development).
Maybe you can make InstantRails meet your needs.
Ruby and thus Ruby on Rails is a fairly notorious deployment on Windows even in the best of circumstances, moreso when the setup is out or your hands like that. I don't mean to admonish, but this definitely speaks to matching development and deployment enviroment (I once ran into similar problems when I found out that the Java enviroment we were deploying to was a good half-a-decade out of date).
As I don't have enough Ruby-on-Windows experience to fairly weigh in on the matter, I'd say either LiveCD's or CygWin deployments may be worth looking at (Always good to broaden people's view on alternate Operating Systems, right?).
Have you considered building a single version that runs in a VM?
For this particular problem, I'd go with a traditional Windows installer package like NSIS.
When I had a client with a Windows-only IT department, though, I found they were much more amenable to an XServer than a linux server. I don't generally think of OS X as a server OS, but it actually worked really well. I tried for linux first, and when they shot it down, I suggested OS X and they jumped at it.
It helped, I think, that they already supported some Mac laptops.
Good luck!
As other posters have suggested, RubyStack should be a good option. It is free and you can always use it to run your own 'post install' scripts to customize it for what you want. If you want a supported stack or addition/modifications to RubyStack you can get commercial support from BitRock We have done so for several Rails based companies that wanted a local version, including for the guys over at GitHub

Ruby on Rails plugin development process

I'm considering developing aspects of a website as Rails plugins for reuse. My question is about the development process. Since each of these plugins will provide a "slice" of functionality, should I develop each "slice" as it's own application and then extract the code from each application into a plugin? Or, should I write them as plugins right in an application? Ultimately I will be linking to these plugins from each site to keep it DRY.
I guess the main question is what would be the development process for creating multiple "Engine" type plugins?
Thanks in advance for any help.
Either approach is valid.
When writing a basic plugin I usually find it easier to write it in tandem with the application that will use it. Because I find it easier to design/test around something that already exists.
However, when it comes to Engine plugins, I prefer to develop them as a separate application and then rip out all the unnecessary bits when I move it into a plugin. They are in essence mini applications, and they should be completely functional when installed on a freshly created rails project.
By designing them as their own application I'm ensuring proper compartmentalization. This ensures that I'm not accidentally referring to code models/controllers/views/helpers that are not a part of the engine I'm developing.
If you're developing multiple engine type plugins this way, you might want to condense a few of the steps with a utility script. Such as one that streamlines the process of turning an application into an Engine plugin.
It should restructure your app as necessary and populate the files that plugins should have, such as init.rb.
You might want to give a look to Desert framework as well .

Resources