Forum: Ruby RubyScript2Exe

734ea0f957bd9a242e2ee819106e582e?d=identicon&s=25 Charlie Openshaw (openshac)
on 2009-04-02 16:50
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-latest.tar.gz

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
86ac8ee8e474b775b482c24b9846a624?d=identicon&s=25 unknown (Guest)
on 2009-04-03 10:30
(Received via mailing list)
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
734ea0f957bd9a242e2ee819106e582e?d=identicon&s=25 Charlie Openshaw (openshac)
on 2009-04-03 10:36
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
Ca515d239bf09ffe970af1da4174eb03?d=identicon&s=25 Lars Christensen (Guest)
on 2009-04-03 10:42
(Received via mailing list)
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.
734ea0f957bd9a242e2ee819106e582e?d=identicon&s=25 Charlie Openshaw (openshac)
on 2009-04-03 15:22
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.
Beb77c4602c3cac7a12149431366ed11?d=identicon&s=25 The Higgs bozo (higgsbozo)
on 2009-04-03 16:48
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)
3af9b1c30beee755b32c660d6687537a?d=identicon&s=25 Brian Wallace (Guest)
on 2009-04-03 16:55
(Received via mailing list)
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
executable
.. 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
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.

On Fri, Apr 3, 2009 at 9:21 AM, Charlie Openshaw <
734ea0f957bd9a242e2ee819106e582e?d=identicon&s=25 Charlie Openshaw (openshac)
on 2009-04-03 17:33
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
734ea0f957bd9a242e2ee819106e582e?d=identicon&s=25 Charlie Openshaw (openshac)
on 2009-04-03 18:15
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
Ca515d239bf09ffe970af1da4174eb03?d=identicon&s=25 Lars Christensen (Guest)
on 2009-04-03 18:36
(Received via mailing list)
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.  I 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 =
"C:/lang/Ruby-186-27/lib/ruby/gems/1.8/gems/rubyscript2exe-0.5.3/realstuff.rb"
$0 = 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]
Cd0dbf751457cf6fed1f69070d37006a?d=identicon&s=25 Charles Johnson (Guest)
on 2009-04-03 20:40
(Received via mailing list)
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
734ea0f957bd9a242e2ee819106e582e?d=identicon&s=25 Charlie Openshaw (openshac)
on 2009-04-06 18:00
Lars,

Thanks for you post, can I just check a couple of things?
1. You managed to get the iplayer-dl-0.1.15.rb compiled as an exe with
rubyscript2exe?
2. Where can i find thie realstuff.rb file that I need to edit, I don't
seem to have it.

Thanks

Charlie


Lars Christensen wrote:
> 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. �I 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 =
> "C:/lang/Ruby-186-27/lib/ruby/gems/1.8/gems/rubyscript2exe-0.5.3/realstuff.rb"
> $0 = 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]
Ca515d239bf09ffe970af1da4174eb03?d=identicon&s=25 Lars Christensen (Guest)
on 2009-04-06 19:17
(Received via mailing list)
On Thu, Apr 2, 2009 at 4:49 PM, Charlie Openshaw
<charlieopenshaw@hotmail.com> wrote:
> ruby "C:\Test\rubyscript2exe\rubyscript2exe.rb"
> "C:\Test\iplayer-dl-0.1.15\lib\iplayer.rb"
>
> However if I try to execute iplayer.exe nothing happens in the console.

You are trying to build a .exe from a Ruby library. Nothing is
supposed to happen when you just load the library. "bin/iplayer-dl"
does the actual work.
734ea0f957bd9a242e2ee819106e582e?d=identicon&s=25 Charlie Openshaw (openshac)
on 2009-04-07 09:31
Lars,

Apologies if I'm being dumb, but I'm really new to ruby

Just to confirm, are you saying that instead of:

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

I should have:

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

I tried that but got :
Gathering Files...
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
'gem_original_require': no such file to load -- iplayer (LoadError)
         from
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
'require'
         from C:/Test/iplayer-dl-0.1.15/bin/iplayer-dl:9
Copying files...
Creating iplyaer-dl.exe ...

Thanks

Charlie

Lars Christensen wrote:
> On Thu, Apr 2, 2009 at 4:49 PM, Charlie Openshaw
> <charlieopenshaw@hotmail.com> wrote:
>> ruby "C:\Test\rubyscript2exe\rubyscript2exe.rb"
>> "C:\Test\iplayer-dl-0.1.15\lib\iplayer.rb"
>>
>> However if I try to execute iplayer.exe nothing happens in the console.
>
> You are trying to build a .exe from a Ruby library. Nothing is
> supposed to happen when you just load the library. "bin/iplayer-dl"
> does the actual work.
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.