# Deploying an application

**URL:** <https://www.ruby-forum.com/t/deploying-an-application/105994>\
**Category:** Ruby\
**Created:** [June 5, 2007, 1:05pm UTC](https://www.ruby-forum.com/t/deploying-an-application/105994 "2007-06-05T13:05:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisfinne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Post date:** [June 5, 2007, 1:05pm UTC](https://www.ruby-forum.com/t/deploying-an-application/105994/1 "2007-06-05T13:05:48Z")

</div>

Hi all,  
I wonder if you could some give some advice to a newbie?  
I am writing an application in ruby at work. I am wondering how do I  
make this available to everyone?  
Am I correct in thinking I have to install ruby on everyone’s PC?

All the PCs at work already have Java installed on them, is it possible  
to use JRuby to compile the program to bytecode? then I wouldn’t have to  
install anything new on all the PCs. Is this a viable option?

Thankyou,  
Chris.

---

<div class="post-metadata">

**Author:** ![chrisfinne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Post date:** [June 5, 2007, 6:04pm UTC](https://www.ruby-forum.com/t/deploying-an-application/105994/2 "2007-06-05T18:04:57Z")

</div>

Chris F. wrote:

> Hi all,  
> I wonder if you could some give some advice to a newbie?  
> I am writing an application in ruby at work. I am wondering how do I  
> make this available to everyone?  
> Am I correct in thinking I have to install ruby on everyone’s PC?
> 
> All the PCs at work already have Java installed on them, is it possible  
> to use JRuby to compile the program to bytecode? then I wouldn’t have to  
> install anything new on all the PCs. Is this a viable option?

JRuby doesn’t yet compile all code to bytecode, but it doesn’t really  
matter. You can just package up everything in a single JAR file and  
distribute that…no mucking about with different compiled versions of  
Ruby, no rubyscript2exe for each target platform. A single file  
containing a complete Ruby implementation and your code that will run on  
any machine with Java.

Let me know if you’d like to hear more…

- Charlie

---

<div class="post-metadata">

**Author:** ![chrisfinne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Post date:** [June 5, 2007, 1:26pm UTC](https://www.ruby-forum.com/t/deploying-an-application/105994/3 "2007-06-05T13:26:48Z")

</div>

On 6/5/07, Chris F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thankyou,  
> Chris.
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Try this.

[http://www.erikveen.dds.nl/rubyscript2exe/index.html](http://www.erikveen.dds.nl/rubyscript2exe/index.html)

Harry

–

A Look into Japanese Ruby List in English  
[http://www.kakueki.com/](http://www.kakueki.com/)

---

<div class="post-metadata">

**Author:** ![chrisfinne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Post date:** [June 5, 2007, 6:41pm UTC](https://www.ruby-forum.com/t/deploying-an-application/105994/4 "2007-06-05T18:41:53Z")

</div>

> Let me know if you’d like to hear more…

A reply from Mr. JRuby himself - what a forum!

Yes please, if you’d be so kind - any tutorial, instructions, further  
information?

---

<div class="post-metadata">

**Author:** ![chrisfinne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Post date:** [June 6, 2007, 3:11pm UTC](https://www.ruby-forum.com/t/deploying-an-application/105994/5 "2007-06-06T15:11:18Z")

</div>

Chris F. wrote:

> > Let me know if you’d like to hear more…
> 
> A reply from Mr. JRuby himself - what a forum!
> 
> Yes please, if you’d be so kind - any tutorial, instructions, further  
> information?

There’s no official tutorial or walkthrough (though there should be). Of  
course you can always just distribute JRuby, but it sounds like you want  
a single package (i.e. a single file?), so basically, there’s two  
options:

1. Add your code at the root of one of the “complete” JRuby JAR files,  
which include all of the Ruby stdlib as well as the full JRuby  
implementation. Once it’s in the file (which is mostly a standard ZIP  
file) you can do someting like the following:

java -jar my-jruby-complete.jar -e "load 'myscript.rb'"
1. You can also modify the JAR by including your code and a “main” Java  
class that knows how to run it. Basically, this would involve a simple  
main method something like the following:

package org.something;

public class MyMain {  
public static void main(String[] args) {  
org.jruby.Main.main(new String[] {“myscript.rb”});  
}  
}

And then an entry in the manifest file in the JAR (under  
META-INF/MANIFEST.MF) like so:

Main-Class: org.someting.MyMain

With this, you could just run the jar directly:

java -jar my-special-jruby.jar

The bottom line in both cases is that no rebuild of JRuby is necessary.  
It’s one-stop-shopping for redistributable Ruby applications!

- Charlie
