# All in one Ruby - HELP!

**URL:** <https://www.ruby-forum.com/t/all-in-one-ruby-help/179319>\
**Category:** Ruby\
**Created:** [November 21, 2009, 11:29pm UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319 "2009-11-21T23:29:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 21, 2009, 11:29pm UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/1 "2009-11-21T23:29:15Z")

</div>

Hey guys!

im trying to run my Ruby scripts in a computer that havent got the Ruby  
interpreter, and my script use a GUI based on GTK. to make this  
standalone ruby im using All in One Ruby. but the GTK libs and stuff are  
not in the package. what shoud i do?  
thanks

---

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 22, 2009, 10:42am UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/2 "2009-11-22T10:42:27Z")

</div>

Guilherme I. wrote:

> Hey guys!
> 
> im trying to run my Ruby scripts in a computer that havent got the Ruby  
> interpreter, and my script use a GUI based on GTK. to make this  
> standalone ruby im using All in One Ruby. but the GTK libs and stuff are  
> not in the package. what shoud i do?  
> thanks

I don’t know All in one Ruby, but I think it makes your script into an  
executable file? What OS are you aiming for? If it’s Windows you could  
try Ocra, that includes libraries just fine (search for it on  
RubyForge).

> GTK libs and stuff  
> The Ruby bindings or GTK itself? If it’s enough to include some DLL  
> files, Ocra should be able to do that, too.

Marvin

---

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 22, 2009, 8:12pm UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/3 "2009-11-22T20:12:27Z")

</div>

THank you Marvin, you helped me a lot

---

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 22, 2009, 8:15pm UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/4 "2009-11-22T20:15:07Z")

</div>

Guilherme I. wrote:

> THank you Marvin, you helped me a lot

About the GTk, i dont know…  
i just want to be able to “compile” the ruby script and run my program  
with GTK  
i can do the same with Tk?  
how i include the DLL ?  
thank you

---

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 22, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/5 "2009-11-22T20:26:41Z")

</div>

Guilherme I. wrote:

> Guilherme I. wrote:
> 
> > THank you Marvin, you helped me a lot
> 
> About the GTk, i dont know…  
> i just want to be able to “compile” the ruby script and run my program  
> with GTK  
> i can do the same with Tk?  
> how i include the DLL ?  
> thank you

## After you’ve installed ocra (gem install ocra) type

## ocra --help

## and look for the option to include DLL files (I don’t have a Windows system to test at the moment and can’t remember the option’s name). Then, copy your DLL file to your Ruby installation’s bin subdirectory. Finally, rename your rubyscript to have the file extension .rbw instead of .rb - that avoids the console window. Note that every #puts and #p now will crash your program unless you redirect $stdout and $stderr to a file. I highly recommand this, because otherwise you won’t be able to read error messages when your program doesn’t run as you intend.

## $stdout = $stderr = File.open(“YourProgram.log”, “a”)

## That’s it - cd into your script’s directory and run

## ocra --include-dll yourdll.dll yourscript.rbw

Or whatever the include DLL option is named.

Marvin

---

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 22, 2009, 8:41pm UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/6 "2009-11-22T20:41:35Z")

</div>

THank you Marvin

---

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 23, 2009, 1:07am UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/7 "2009-11-23T01:07:34Z")

</div>

Guilherme I. wrote:

> Guilherme I. wrote:
> 
> > THank you Marvin, you helped me a lot
> 
> About the GTk, i dont know…  
> i just want to be able to “compile” the ruby script and run my program  
> with GTK  
> i can do the same with Tk?  
> how i include the DLL ?  
> thank you

You might want to use JRuby instead, and compile the whole thing into a  
Java app.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![belitos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/67e7ee/32.png) [@belitos](https://www.ruby-forum.com/u/belitos)\
**Post date:** [November 23, 2009, 1:40am UTC](https://www.ruby-forum.com/t/all-in-one-ruby-help/179319/8 "2009-11-23T01:40:54Z")

</div>

Marnen Laibow-Koser wrote:

> Guilherme I. wrote:
> 
> > Guilherme I. wrote:
> > 
> > > THank you Marvin, you helped me a lot
> > 
> > About the GTk, i dont know…  
> > i just want to be able to “compile” the ruby script and run my program  
> > with GTK  
> > i can do the same with Tk?  
> > how i include the DLL ?  
> > thank you
> 
> You might want to use JRuby instead, and compile the whole thing into a  
> Java app.
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

It’s better than use Ocra?  
but i still need a Java interpreter right?
