Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

All in one Ruby - HELP!

1 view
Skip to first unread message

Guilherme Iscaro

unread,
Nov 21, 2009, 5:29:17 PM11/21/09
to
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
--
Posted via http://www.ruby-forum.com/.

Marvin Gülker

unread,
Nov 22, 2009, 4:43:25 AM11/22/09
to
Guilherme Iscaro 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

Guilherme Iscaro

unread,
Nov 22, 2009, 2:12:29 PM11/22/09
to
THank you Marvin, you helped me a lot

Guilherme Iscaro

unread,
Nov 22, 2009, 2:15:09 PM11/22/09
to
Guilherme Iscaro 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

Marvin Gülker

unread,
Nov 22, 2009, 2:26:54 PM11/22/09
to
Guilherme Iscaro wrote:
> Guilherme Iscaro 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

Guilherme Iscaro

unread,
Nov 22, 2009, 2:41:39 PM11/22/09
to

THank you Marvin

Marnen Laibow-Koser

unread,
Nov 22, 2009, 7:07:35 PM11/22/09
to
Guilherme Iscaro wrote:
> Guilherme Iscaro 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
mar...@marnen.org

Guilherme Iscaro

unread,
Nov 22, 2009, 7:40:56 PM11/22/09
to

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

0 new messages