RubyScript2EXE Not Functioning

Discussion in 'Ruby' started by Richard Manning, Feb 7, 2007.

  1. I've just downloaded Erik Veenstra's RubyScript2EXE, but it does not
    seem to work correctly at all. Here's what I've done:

    1. I downloaded the latest rubyscript2exe.rb to my working folder, with
    the .RB to be packaged (in this case, hello-world.rb).

    2. I opened a command prompt, navigated to the working folder, and ran
    the command "ruby rubyscript2exe.rb hello-world.rb".

    3. There is a very brief pause, and the line "Tracing hello-world ..."
    appears. Whatever process that seemed briefly to be running appears to
    quit, and a glance at the Windows Task Manager shows no activity. I'm
    left with just a blank line, as though the program is asking for input,
    though nothing I type elicits a response except CTRL-C, at which point
    the following is spit out:

    Couldn't execute this command (rc=256):
    c:\ruby\bin\ruby -r 'rubyscript2exe.rb' -I
    'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2
    rubyscript.d.3712.1/rubyscript2exe' -I
    'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2ruby
    script.d.3712.1' -I 'c:/ruby/lib/ruby/site_ruby/1.8' -I
    'c:/ruby/lib/ruby/site_r
    uby/1.8/i386-msvcrt' -I 'c:/ruby/lib/ruby/site_ruby' -I
    'c:/ruby/lib/ruby/1.8' -
    I 'c:/ruby/lib/ruby/1.8/i386-mswin32' -I '.' -I 'C:/Documents and
    Settings/Owner
    /My Documents/Rick's/Ruby' -I
    'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.
    3712.1/rubyscript2exe' -I
    'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.3712
    1/rubyscript2exe' -I
    'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.3712.1/r
    ubyscript2exe/lib' -r
    'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.3712.1/r
    ubyscript2exe/require2lib.rb' 'hello-world.rb'
    Stopped.

    I've found no similar problem to this anywhere online, so I'm tempted to
    think I've made an egregious oversight somewhere.

    Thank you very much!
    :Rick:.

    --
    Posted via http://www.ruby-forum.com/.
    Richard Manning, Feb 7, 2007
    #1
    1. Advertising

  2. Richard Manning

    mully Guest

    On Feb 6, 10:16 pm, Richard Manning <>
    wrote:
    > I've just downloaded Erik Veenstra's RubyScript2EXE, but it does not
    > seem to work correctly at all. Here's what I've done:
    >
    > 1. I downloaded the latest rubyscript2exe.rb to my working folder, with
    > the .RB to be packaged (in this case, hello-world.rb).
    >
    > 2. I opened a command prompt, navigated to the working folder, and ran
    > the command "ruby rubyscript2exe.rb hello-world.rb".
    >
    > 3. There is a very brief pause, and the line "Tracing hello-world ..."
    > appears. Whatever process that seemed briefly to be running appears to
    > quit, and a glance at the Windows Task Manager shows no activity. I'm
    > left with just a blank line, as though the program is asking for input,
    > though nothing I type elicits a response except CTRL-C, at which point
    > the following is spit out:
    >
    > Couldn't execute this command (rc=256):
    > c:\ruby\bin\ruby -r 'rubyscript2exe.rb' -I
    > 'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2
    > rubyscript.d.3712.1/rubyscript2exe' -I
    > 'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2ruby
    > script.d.3712.1' -I 'c:/ruby/lib/ruby/site_ruby/1.8' -I
    > 'c:/ruby/lib/ruby/site_r
    > uby/1.8/i386-msvcrt' -I 'c:/ruby/lib/ruby/site_ruby' -I
    > 'c:/ruby/lib/ruby/1.8' -
    > I 'c:/ruby/lib/ruby/1.8/i386-mswin32' -I '.' -I 'C:/Documents and
    > Settings/Owner
    > /My Documents/Rick's/Ruby' -I
    > 'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.
    > 3712.1/rubyscript2exe' -I
    > 'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.3712
    > 1/rubyscript2exe' -I
    > 'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.3712.1/r
    > ubyscript2exe/lib' -r
    > 'C:/DOCUME~1/Owner/LOCALS~1/Temp/tar2rubyscript.d.3712.1/r
    > ubyscript2exe/require2lib.rb' 'hello-world.rb'
    > Stopped.
    >
    > I've found no similar problem to this anywhere online, so I'm tempted to
    > think I've made an egregious oversight somewhere.
    >
    > Thank you very much!
    > :Rick:.
    >
    > --
    > Posted viahttp://www.ruby-forum.com/.


    You might try including the following at the end of your require
    statements:

    require "rubyscript2exe"
    exit if RUBYSCRIPT2EXE.is_compiling?

    This is per section 3.4 of Erik's documentation:

    http://www.erikveen.dds.nl/rubyscript2exe/index.html

    Mully
    mully, Feb 7, 2007
    #2
    1. Advertising

  3. Erik Veenstra, Feb 7, 2007
    #3
  4. Richard Manning

    bbiker Guest

    On Feb 7, 10:57 am, "Erik Veenstra" <> wrote:
    > Please cat your hello-world.rb.
    >
    > gegroet,
    > Erik V. -http://www.erikveen.dds.nl/


    This may be slightly off-topic

    On a WindowsXP box, with ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-
    mswin32] and rubyscript2exe 0.5.1

    the way to use the compiler is as follows:

    rubyscript2exe <script_to_compile.rb> [parameters] from your working
    directory

    if you use
    ruby rubyscript2exe.rb <script_to_compile.rb> [parameters]

    you need to have "rubyscript2exe.rb" in your working directory and
    "realstuff.rb" in the parent directory of your working directory.

    This information is not available from the current documentation.
    bbiker, Feb 7, 2007
    #4
  5. > you need to have "rubyscript2exe.rb" in your working
    > directory and "realstuff.rb" in the parent directory of your
    > working directory.
    >
    > This information is not available from the current
    > documentation.


    The documentation refers to the original rubyscript2exe.rb, not
    the gem version.

    If you use the original rubyscript2exe.rb:

    $ ruby rubyscript2exe.rb ...

    If you installed the gem, it's:

    $ rubyscript2exe ...

    Anyway, I fixed the documentation... ;]

    Thanks.

    gegroet,
    Erik V. - http://www.erikveen.dds.nl/
    Erik Veenstra, Feb 11, 2007
    #5
  6. Richard Manning

    bbiker Guest

    On Feb 11, 11:20 am, "Erik Veenstra" <> wrote:
    > > you need to have "rubyscript2exe.rb" in your working
    > > directory and "realstuff.rb" in the parent directory of your
    > > working directory.

    >
    > > This information is not available from the current
    > > documentation.

    >
    > The documentation refers to the original rubyscript2exe.rb, not
    > the gem version.
    >
    > If you use the original rubyscript2exe.rb:
    >
    > $ ruby rubyscript2exe.rb ...
    >
    > If you installed the gem, it's:
    >
    > $ rubyscript2exe ...
    >
    > Anyway, I fixed the documentation... ;]
    >


    Thank you for fixing the documentation.

    Extract from online manual
    ########################################################################################################################################
    a) Just Scanning, no Running
    RubyScript2Exe runs the application (in a child process) and gathers
    the require-d files. It's not necessary to run the complete
    application when all require-s are done in the first couple of
    statements. You might as well exit right after the require statements:

    require "rubyscript2exe"
    exit if RUBYSCRIPT2EXE.is_compiling?
    Sometimes, one or more require-s are done later on, deep down in a
    library (e.g. when connecting to a database in DBI). It's not a good
    idea to do the above trick under this kind of circumstances. You'll
    miss some libraries...
    #########################################################################################################################################

    when I place the above after my 'require's, this is the result.

    K:\ruby\Projects\DDA\lib>df_dda.rb
    K:/ruby/Projects/DDA/lib/df_dda.rb:11: uninitialized constant
    RUBYSCRIPT2EXE (NameError)

    When compiling, the script does exit and compiling takes much less
    time.

    However, if I place: "exit if defined?(REQUIRE2LIB)"
    This allows the script to run to completion when invoked as a ruby
    script and when compiling the script does terminate so that compiling
    can proceed. The compile time seems to be above the same as the above.

    This was documented in a previous version of rubyscript2exe.

    I take it that it is still a valid method to prevent a script from
    running after all the 'require's have occurred.
    bbiker, Feb 11, 2007
    #6
  7. > K:/ruby/Projects/DDA/lib/df_dda.rb:11: uninitialized constant
    > RUBYSCRIPT2EXE (NameError)
    >
    > When compiling, the script does exit and compiling takes much
    > less time.


    Did you add "require rubyscript2exe"?

    gegroet,
    Erik V. - http://www.erikveen.dds.nl/
    Erik Veenstra, Feb 12, 2007
    #7
  8. Richard Manning

    bbiker Guest

    On Feb 12, 4:21 am, "Erik Veenstra" <> wrote:
    > > K:/ruby/Projects/DDA/lib/df_dda.rb:11: uninitialized constant
    > > RUBYSCRIPT2EXE (NameError)

    >
    > > When compiling, the script does exit and compiling takes much
    > > less time.

    >
    > Did you add "require rubyscript2exe"?
    >


    yes, I have the following 2 lines:

    require "rubyscript2exe"
    exit if RUBYSCRIPT2EXE.is_compiling?

    This works if I am compiling the script. I get the error message when
    I run the uncompiled script (script.rb), no problem when running the
    compiled script (script.exe).

    "exit if defined?(REQUIRE2LIB)" does not interfer while running an
    uncompiled script. It appears to work correctly when compiling a
    script.
    The above works without the 'require "rubyscript2exe"' statement.
    bbiker, Feb 12, 2007
    #8
  9. require "rubygems"
    require "rubyscript2exe"
    exit if RUBYSCRIPT2EXE.is_compiling?
    Erik Veenstra, Feb 12, 2007
    #9
  10. Richard Manning

    bbiker Guest

    On Feb 12, 12:32 pm, "Erik Veenstra" <> wrote:
    > require "rubygems"
    > require "rubyscript2exe"
    > exit if RUBYSCRIPT2EXE.is_compiling?



    I am using ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]
    installed via the one-click installer.
    'require "rubygens"' statement is not needed, since I chose to enable
    rubygems during the installation.

    gem -v 0.9.2

    echo %RUBYOP% => -rubygems

    Adding 'require "rubygems"' yied the same result.
    bbiker, Feb 12, 2007
    #10
  11. Erik Veenstra wrote:
    > Please cat your hello-world.rb.
    >
    > gegroet,
    > Erik V. - http://www.erikveen.dds.nl/


    My script originally consisted of the following line:

    puts "Hello World!"

    However, it still does not work when I insert these lines at the top:

    require "rubyscript2exe"
    exit if RUBYSCRIPT2EXE.is_compiling?

    I would love to get this to work -- rubyscript2exe seems like a great
    program.

    Thanks!

    :Rick:.

    --
    Posted via http://www.ruby-forum.com/.
    Richard Manning, Feb 12, 2007
    #11
  12. Richard Manning

    bbiker Guest

    On Feb 12, 3:35 pm, Richard Manning <>
    wrote:
    > Erik Veenstra wrote:
    > > Please cat your hello-world.rb.

    >
    > > gegroet,
    > > Erik V. -http://www.erikveen.dds.nl/

    >
    > My script originally consisted of the following line:
    >
    > puts "Hello World!"
    >
    > However, it still does not work when I insert these lines at the top:
    >
    > require "rubyscript2exe"
    > exit if RUBYSCRIPT2EXE.is_compiling?
    >
    > I would love to get this to work -- rubyscript2exe seems like a great
    > program.
    >
    > Thanks!
    >
    > :Rick:.
    >
    > --
    > Posted viahttp://www.ruby-forum.com/.


    rubyscript2exe works.

    For example: type in the following program
    #---------------------------------------------
    #!c:/ruby/bin/ruby
    require "rubyscript2exe"
    exit if RUBYSCRIPT2EXE.is_compiling?

    puts "Hello Ruby World"
    #---------------------------------------------

    Note that for such a short program the require and exit statements are
    not needed!!!
    They are only needed if the script has a long running time.

    The problem with these two lines comes when you want to run the
    hello.rb script.

    compile the program.
    C:\Documents and Settings\...\default_project>rubyscript2exe hello.rb
    Tracing hello ...
    Gathering files...
    Copying files...
    Creating hello.exe ...

    invoke the executable
    C:\Documents and Settings\...\default_project>hello
    Hello Ruby World

    please note the sizes of the files.
    dir hello.*
    Directory of C:\Documents and Settings\..\default_project

    02/12/2007 04:42 PM 1,553,436 hello.exe
    02/12/2007 04:33 PM 143 hello.rb
    bbiker, Feb 12, 2007
    #12
  13. bbiker wrote:
    > rubyscript2exe works.


    I'm not claiming that the program doesn't work -- I just can seem to get
    it working for me!

    I've tried the above example, step-by-step, but it still hangs on
    "Tracing hello ..." Is there some sort of configuration or file
    placement that I've overlooked, or something like that?

    Thanks, and sorry for the trouble.
    :Rick:.

    --
    Posted via http://www.ruby-forum.com/.
    Richard Manning, Feb 17, 2007
    #13
  14. Richard Manning

    bbiker Guest

    On Feb 17, 6:55 pm, Richard Manning <>
    wrote:
    > bbiker wrote:
    > > rubyscript2exe works.

    >
    > I'm not claiming that the program doesn't work -- I just can seem to get
    > it working for me!
    >
    > I've tried the above example, step-by-step, but it still hangs on
    > "Tracing hello ..." Is there some sort of configuration or file
    > placement that I've overlooked, or something like that?
    >
    > Thanks, and sorry for the trouble.
    > :Rick:.
    >
    > --
    > Posted viahttp://www.ruby-forum.com/.


    Should work right out of the box .. no configuration needed as far as
    I know.

    Suggest that you uninstall the rubyscript2exe gem and reinstall it.

    bbiker
    bbiker, Feb 18, 2007
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sadf
    Replies:
    4
    Views:
    810
    Bob Carsto
    Nov 14, 2003
  2. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    Enable property of a Panel not functioning

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Feb 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    353
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Feb 7, 2005
  3. surveyor04
    Replies:
    0
    Views:
    373
    surveyor04
    Feb 12, 2005
  4. Neo Geshel
    Replies:
    5
    Views:
    847
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Jun 14, 2005
  5. =?Utf-8?B?Q2hyeXNhbg==?=

    Comboxbox's SelectedIndexChanged event not functioning

    =?Utf-8?B?Q2hyeXNhbg==?=, Sep 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    426
    =?Utf-8?B?Q2hyeXNhbg==?=
    Sep 29, 2005
Loading...

Share This Page