Forum: Ruby-Gnome 2 a newbie question:how to pack it into .exe file

Ca6d571a854e213cc8897387a18fbaa2?d=identicon&s=25 Rossi Kenneth (redknight)
on 2013-02-19 12:54
hello,i am a newbie learner of RB and visualruby

I found it difficult for me to trans a visualruby program(.rb&.glade)
into a .exe file which could run correctly in win7 .

Now i could only use
exerb for a simple ruby program(.rb).

would anyone kindly help me about that?
0d130f179f85401f248e6ebc2ef8292f?d=identicon&s=25 Eric C. (eric_c)
on 2013-02-20 05:37
Hi:

The way to distribute programs is to package them as rubygems.  You need
to make an executable file in the rubygem, and when the gem is
installed, the user can run the program by typing the filename at the
command prompt.  For example, the visualruby program has a file named
"vr" that installs in the gem directory.  So when a user types "vr" at
the command prompt, visualruby runs.

In visualruby, create a gemspec file, and make an executable file.  For
more info:

rubygems.org

has documentation.

The gemspecs are a bit confusing because everything is allowed to have a
different name (the program, the executable, the project and the gem).
Try using the visualruby examples to learn.

Good luck,
Eric
Ca6d571a854e213cc8897387a18fbaa2?d=identicon&s=25 Rossi Kenneth (redknight)
on 2013-02-20 13:10
Eric C. wrote in post #1097900:
> Hi:
>
> The way to distribute programs is to package them as rubygems.  You need
> to make an executable file in the rubygem, and when the gem is
> installed, the user can run the program by typing the filename at the
> command prompt.  For example, the visualruby program has a file named
> "vr" that installs in the gem directory.  So when a user types "vr" at
> the command prompt, visualruby runs.
>
> In visualruby, create a gemspec file, and make an executable file.  For
> more info:
>
> rubygems.org
>
> has documentation.
>
> The gemspecs are a bit confusing because everything is allowed to have a
> different name (the program, the executable, the project and the gem).
> Try using the visualruby examples to learn.
>
> Good luck,
> Eric

hello,Eric,thank you for your kind answer.
But I am afraid that you may misunderstand what i meant.
To make the question clear:
Could somebody use my vr-program without installing ruby?How?
BTW:
I got another quention:When I run the vr-program(by "ruby main.rb"),I
got a really big cmd-window.
How can I get rid of it?

Thanks again for your help! ;-)
C4a836af7263f84a4f7cc91ed6f3ae77?d=identicon&s=25 Vincent Carmona (vinc-mai)
on 2013-02-20 16:21
(Received via mailing list)
Hi.


> hello,Eric,thank you for your kind answer.
> But I am afraid that you may misunderstand what i meant.
> To make the question clear:
> Could somebody use my vr-program without installing ruby?How?
>

No.
But in theory you can package your program and your dependencies
including
ruby in one big windows installation file.
See http://rubyscript2exe.rubyforge.org/ for example.
Ca6d571a854e213cc8897387a18fbaa2?d=identicon&s=25 Rossi Kenneth (redknight)
on 2013-02-20 17:51
Vincent Carmona wrote in post #1097983:

> No.
> But in theory you can package your program and your dependencies
> including
> ruby in one big windows installation file.
> See http://rubyscript2exe.rubyforge.org/ for example.

Thanks!it helps me a lot

I got another question:
When I run the vr-program(not by "ruby main.rb" but by double-click),I
got a cmd-window behind my gui.

How can I get rid of it?
B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (raubarede)
on 2013-02-20 21:17
>> ruby in one big windows installation file.

On windows, Ocra do all : ruby executable embeded, gem too.
But i think that Gtk/glade must be installed by thinks
like http://sourceforge.net/projects/gtk-win/files/

> When I run the vr-program(not by "ruby main.rb" but by double-click),I
> got a cmd-window behind my gui.

Rubyw.exe run ruby without console.
for running rubyw on click, rename main.rb by main.rbw

or you can use hstart :
> hstart /noconsole "ruby main.rb"
Ca6d571a854e213cc8897387a18fbaa2?d=identicon&s=25 Rossi Kenneth (redknight)
on 2013-02-21 11:20
Regis d'Aubarede wrote in post #1098049:
>>> ruby in one big windows installation file.
>
> On windows, Ocra do all : ruby executable embeded, gem too.
> But i think that Gtk/glade must be installed by thinks
> like http://sourceforge.net/projects/gtk-win/files/
>
>> When I run the vr-program(not by "ruby main.rb" but by double-click),I
>> got a cmd-window behind my gui.
>
> Rubyw.exe run ruby without console.
> for running rubyw on click, rename main.rb by main.rbw
>
> or you can use hstart :
>> hstart /noconsole "ruby main.rb"

Thank you!
It works.
;-D
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.