# Deploying Ruby on Rails as a standalone exe

**URL:** <https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676>\
**Category:** Rails\
**Created:** [September 6, 2006, 12:08am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676 "2006-09-06T00:08:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 6, 2006, 12:08am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676/1 "2006-09-06T00:08:42Z")

</div>

I’m trying to deploy a ruby on rails application. It uses sqlite3 for  
a database. What I would like to do is distribute it as a windows  
executable. It should be in such a way that the user can click on the  
application and everything will load and a full screen browser window  
will appear. This way the user will know nothing about it being a  
browser and need no ruby components installed to run the application.

Has anyone done anything like this?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 6, 2006, 1:51am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676/2 "2006-09-06T01:51:33Z")

</div>

> Has anyone done anything like this?

Check this out:

[Distributing  
Rails Applications](http://www.erikveen.dds.nl/distributingrubyapplications/rails.html)

Looks like you would need to handle the opening of a browser window and  
make some decisions about where to store your database files.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 6, 2006, 1:52am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676/3 "2006-09-06T01:52:16Z")

</div>

Okay, auto-linky!

[http://www.erikveen.dds.nl/distributingrubyapplications/rails.html](http://www.erikveen.dds.nl/distributingrubyapplications/rails.html)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 7, 2006, 5:25pm UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676/4 "2006-09-07T17:25:20Z")

</div>

@Richard:

“There are other potential benefits - this can obfuscate your source,  
and  
even trivialise your Rails install if you need to ship it to people who  
thing  
Ruby is a wedding anniversary and Rails are things that trains run on.”

It actually just TARs up the source, wraps it with an executable, and  
extracts the whole thing to a temp folder in order to run. Anyone  
willing to  
look for the temp folder would see your source.

I spent some time with this approach only to find out that it doesn’t  
quite  
work because there are lots of different configuration issues you need  
to  
deal with such as logging, locations of database files, etc. Not good  
for  
mass deployment, that’s for sure.

If you want a way to send apps to folks who know nothing about Ruby, you  
could use an installer created with the free InnoSetup program. You can  
bundle all of the necessary gems with the installer and have the  
installer  
do the gem installs. Make the installer invoke One-Click Ruby installer  
if  
you want a push-button solution. Then just have your installer copy the  
required files, invoke mongrel\_rails service::install at the end of the  
setup.

I’m already doing this now and it’s pretty easy.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 7, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676/5 "2006-09-07T16:15:10Z")

</div>

On 9/5/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m trying to deploy a ruby on rails application.

> Has anyone done anything like this?

Conor,  
once you have compacted your Rails app into an exe, you could do  
something  
as simple as make a second executable (maybe a batch file or the  
equivalent  
of a windows shortcut) that calls your Rails App.exe and then invokes  
the web browser to launch and point to it.

I think I know what you are trying to achieve here, and getting the  
rails app  
into an exe is the challenging part (that is properly solved by the  
linked  
article). Getting a browser to launch and point somewhere is easy. Doing  
the tasks independently is very easy to accomplish, trying to get the  
Rails App.exe to launch browsers as well could overcomplicate a  
non-trivial task.

As others have mentioned, you may have issues with post-install setup,  
like configuring/pointing to/creating your sqlite databases. You might  
also want to do things like install-as-service, or ensure that  
RailsApp.exe  
runs on bootup.

As an aside, has anyone got some metrics on the size of the resulting  
Rails2Exe executable? I have considered compiling ruby/rails to  
executables  
as a way of potentially getting around the size of a rails/ruby app  
distribution,  
if it ever became an issue. (like if we needed to do things like deploy  
over  
the network).

There are other potential benefits - this can obfuscate your source, and  
even trivialise your Rails install if you need to ship it to people who  
thing  
Ruby is a wedding anniversary and Rails are things that trains run on.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 7, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-as-a-standalone-exe/67676/6 "2006-09-07T20:15:43Z")

</div>

On 9/7/06, Brian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It actually just TARs up the source, wraps it with an executable, and  
> extracts the whole thing to a temp folder in order to run. Anyone willing to  
> look for the temp folder would see your source.

Aw crap. I was looking at Ruby _compilers_ at the time too and must have  
got them confused.

> If you want a way to send apps to folks who know nothing about Ruby, you  
> could use an installer created with the free InnoSetup program. You can  
> bundle all of the necessary gems with the installer and have the installer  
> do the gem installs. Make the installer invoke One-Click Ruby installer if  
> you want a push-button solution. Then just have your installer copy the  
> required files, invoke mongrel\_rails service::install at the end of the  
> setup.

Nods. Its something I have to consider down the road anyway. I did think  
it would be easier to do this if your Rails app was an exe as well, but  
I will have to search more.

I am primarily interested in Rails App as exe, to see if I can get the  
distribution size down. Code obfuscation is nice too.

In my case, I also need to consider Mac OS/Linux/other \*NIX packaging/  
installation systems. And I need to make it scriptable so I can bundle  
up my Rails app at the tail end of a build process.

> I’m already doing this now and it’s pretty easy.

Certainly mongrel+sqlite makes Rails installation a _lot_ easier.
