[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RubyScript2Exe

Charlie Openshaw

4/2/2009 2:50:00 PM

Hi,

I am a complete novice to ruby, so please feel free to ask for more
information so this post makes more sense.

I am trying to create an exe from the ruby script, and it all seems to
go well but the resulting exe doesn't do what it's supposed to. Well it
doesn't do anything at all in fact!

I am creating the exe from the ruby script at:

http://po-ru.com/files/iplayer-dl-lat...

I've created 2 folders:

1. C:\Test:\rubyscript2exe
2. C:\Test\iplayer-dl-0.1.15

1. Contains all the rubyscript2exe files and the ev directory.
2. Contains the files and folders from the above link.

I then run the following line in my command prompt (Win XP)

ruby "C:\Test\rubyscript2exe\rubyscript2exe.rb"
"C:\Test\iplayer-dl-0.1.15\lib\iplayer.rb"

It starts to looks good with the following output:
Tracing iplayer ...
Gathering files ...
Copying files ...
Creating iplayer.exe

However if I try to execute iplayer.exe nothing happens in the console.
I just get the console prompt after a short pause.
I am expecting to receive a whole load of relevant help information
about iplayer.exe

I've managed to get this to work before but for some reason I can't get
the exe working anymore. Is there something dumb that I'm doing?

Charlie
--
Posted via http://www.ruby-....

22 Answers

Axel

4/3/2009 8:29:00 AM

0

Hello Charlie,

> However if I try to execute iplayer.exe nothing happens in the console.
> I just get the console prompt after a short pause.

Maybe, the console prompt shows the right messages for, say, some
milli-seconds and then imediately disappears?
To avoid this, you can do:

Invoke a persisten Console Window (in German Windows it is: Start >
Ausfuehren > type "cmd" <return> )
In the console window run your iplayer.exe; maybe you have to use the
full path.

Axel

Charlie Openshaw

4/3/2009 8:36:00 AM

0

Axel,

Thanks for you post but I am already using the Command Prompt (Start >
Run > cmd)
:-(

Charlie


unknown wrote:
> Hello Charlie,
>
>> However if I try to execute iplayer.exe nothing happens in the console.
>> I just get the console prompt after a short pause.
>
> Maybe, the console prompt shows the right messages for, say, some
> milli-seconds and then imediately disappears?
> To avoid this, you can do:
>
> Invoke a persisten Console Window (in German Windows it is: Start >
> Ausfuehren > type "cmd" <return> )
> In the console window run your iplayer.exe; maybe you have to use the
> full path.
>
> Axel

--
Posted via http://www.ruby-....

Lars Christensen

4/3/2009 8:41:00 AM

0

On Thu, Apr 2, 2009 at 4:49 PM, Charlie Openshaw
<charlieopenshaw@hotmail.com> wrote:
> Hi,
>
> I am a complete novice to ruby, so please feel free to ask for more
> information so this post makes more sense.
>
> I am trying to create an exe from the ruby script, and it all seems to
> go well but the resulting exe doesn't do what it's supposed to. =A0Well i=
t
> doesn't do anything at all in fact!

I had a quick look at rubyscript2exe yesterday. It's not currently
maintained and is not compatible with current versions of Ruby (throws
exceptions with 1.8.6p287). I would not recommend it for use in its
current state.

Charlie Openshaw

4/3/2009 1:22:00 PM

0

Lars,

Thanks for taking the time to help me.

As I mentioned in my original post I've managed to get this to work
before but for some reason I can't get the exe working anymore.

It says it's supported up to version 1.8, and I've got 1.8.26, so would
it be best to just install version 1.8 of Ruby?

Charlie


Lars Christensen wrote:
> On Thu, Apr 2, 2009 at 4:49 PM, Charlie Openshaw
> <charlieopenshaw@hotmail.com> wrote:
>> Hi,
>>
>> I am a complete novice to ruby, so please feel free to ask for more
>> information so this post makes more sense.
>>
>> I am trying to create an exe from the ruby script, and it all seems to
>> go well but the resulting exe doesn't do what it's supposed to. �Well it
>> doesn't do anything at all in fact!
>
> I had a quick look at rubyscript2exe yesterday. It's not currently
> maintained and is not compatible with current versions of Ruby (throws
> exceptions with 1.8.6p287). I would not recommend it for use in its
> current state.

--
Posted via http://www.ruby-....

The Higgs bozo

4/3/2009 2:48:00 PM

0

Lars Christensen wrote:
> On Thu, Apr 2, 2009 at 4:49 PM, Charlie Openshaw
> <charlieopenshaw@hotmail.com> wrote:
>> Hi,
>>
>> I am a complete novice to ruby, so please feel free to ask for more
>> information so this post makes more sense.
>>
>> I am trying to create an exe from the ruby script, and it all seems to
>> go well but the resulting exe doesn't do what it's supposed to. �Well it
>> doesn't do anything at all in fact!
>
> I had a quick look at rubyscript2exe yesterday. It's not currently
> maintained and is not compatible with current versions of Ruby (throws
> exceptions with 1.8.6p287). I would not recommend it for use in its
> current state.

Nah, rubyscript2exe.rb works like a charm. I assume you are talking
about the frozen string exception which is a trivial fix (below).

I understand your concern that it has not been updated for a while, but
on the other hand it doesn't need any updating apart from this one-liner
fix. It is not uncommon for someone to write a sweet tool and then fall
off the Earth for a time. You can help by writing the author
[rubyscript2exe at erikveen dot dds dot nl], or if you live in
Netherlands knock on his door and say, "Yo, change that line!" in Dutch.

--- rubyscript2exe.rb.orig 2009-04-03 10:28:41.140806000 -0400
+++ rubyscript2exe.rb 2009-04-03 10:29:40.108423800 -0400
@@ -618,7 +618,7 @@

newlocation do
if __FILE__ == $0
- $0.replace(File.expand_path("./init.rb"))
+ $0 = File.expand_path("./init.rb")

TAR2RUBYSCRIPT = true unless defined?(TAR2RUBYSCRIPT)
--
Posted via http://www.ruby-....

Brian Wallace

4/3/2009 2:54:00 PM

0

I've been using rubyscript2exe with 1.8.7 without any problems.

I've tested it in Vista + XP ... It uses an "eee" wrapper for the executabl=
e
.. You'll find that when you run an exe compiled by rubyscript2exe, it
extracts all of the files into:

\Documents and Settings\<username>\eee
There is an option to just extract the files from Rubyscript2exe and not ru=
n
the .RB, I would extract the files, and make sure your application runs via
"ruby scriptname.rb" in the directory that it extracts to.

The argument to pass to your compiled exe is --eee-just-extract.

On Fri, Apr 3, 2009 at 9:21 AM, Charlie Openshaw <
charlieopenshaw@hotmail.com> wrote:

> Lars,
>
> Thanks for taking the time to help me.
>
> As I mentioned in my original post I've managed to get this to work
> before but for some reason I can't get the exe working anymore.
>
> It says it's supported up to version 1.8, and I've got 1.8.26, so would
> it be best to just install version 1.8 of Ruby?
>
> Charlie
>
>
> Lars Christensen wrote:
> > On Thu, Apr 2, 2009 at 4:49 PM, Charlie Openshaw
> > <charlieopenshaw@hotmail.com> wrote:
> >> Hi,
> >>
> >> I am a complete novice to ruby, so please feel free to ask for more
> >> information so this post makes more sense.
> >>
> >> I am trying to create an exe from the ruby script, and it all seems to
> >> go well but the resulting exe doesn't do what it's supposed to. =EF=BF=
=BDWell it
> >> doesn't do anything at all in fact!
> >
> > I had a quick look at rubyscript2exe yesterday. It's not currently
> > maintained and is not compatible with current versions of Ruby (throws
> > exceptions with 1.8.6p287). I would not recommend it for use in its
> > current state.
>
> --
> Posted via http://www.ruby-....
>
>

Charlie Openshaw

4/3/2009 3:33:00 PM

0

Higgs Bozo,

Thanks for your post, it's good to know that there's an update.

I applied the change you suggested but with no luck, I get the same
behaviour (it says it's created the new exe, but the exe doesn't do
anything when it runs).

Charlie
--
Posted via http://www.ruby-....

Charlie Openshaw

4/3/2009 4:15:00 PM

0

Brian,

That's really interesting Brian because I'm not getting anything in

C:\Documents and Settings\<username>\eee
When I run the exe I actually get a file created, but it then
disappears!

Brian Wallace wrote:
> There is an option to just extract the files from Rubyscript2exe and not
> run
> the .RB, I would extract the files, and make sure your application runs
> via
> "ruby scriptname.rb" in the directory that it extracts to.
>
> The argument to pass to your compiled exe is --eee-just-extract.
>

I'm really sorry I'm not sure what you mean. Is this an option for
creating the exe or running the exe?

Charlie

--
Posted via http://www.ruby-....

Lars Christensen

4/3/2009 4:35:00 PM

0

On Fri, Apr 3, 2009 at 4:47 PM, The Higgs bozo <higgs.bozo@gmail.com> wrote=
:
> Lars Christensen wrote:
>> On Thu, Apr 2, 2009 at 4:49 PM, Charlie Openshaw
>> <charlieopenshaw@hotmail.com> wrote:
>
> Nah, rubyscript2exe.rb works like a charm. =A0I assume you are talking
> about the frozen string exception which is a trivial fix (below).

Sorry, it does work with your fix, but still not via the gem. I need
to invoke realstuff.rb directly.

The $0 mangling is not working with paths on my setup:

This script:

a =3D "C:/lang/Ruby-186-27/lib/ruby/gems/1.8/gems/rubyscript2exe-0.5.3/real=
stuff.rb"
$0 =3D a
p a
p $0

Gives me:

"C:/lang/Ruby-186-27/lib/ruby/gems/1.8/gems/rubyscript2exe-0.5.3/realstuff.=
rb"
"C:/lang/Ruby-186-27/lib/ruby/gems/1.8/gems/rubyscript2exe-0.5"

ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]

cnjohnson

4/3/2009 6:37:00 PM

0

On Apr 3, 2009, at 9:47 AM, The Higgs bozo wrote:

> I understand your concern that it has not been updated for a while,
> but
> on the other hand it doesn't need any updating apart from this one-
> liner
> fix. It is not uncommon for someone to write a sweet tool and then
> fall
> off the Earth for a time. You can help by writing the author
> [rubyscript2exe at erikveen dot dds dot nl], or if you live in
> Netherlands knock on his door and say, "Yo, change that line!" in
> Dutch.


Something like "Verander dat lijn." ought to do it.

Cheers--

Charles
---
Charles Johnson
Advanced Computing Center for Research and Education
Vanderbilt University