[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

RubyScript2EXE Not Functioning

Richard Manning

2/7/2007 3:17:00 AM

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-....

18 Answers

David Mullet

2/7/2007 2:50:00 PM

0

On Feb 6, 10:16 pm, Richard Manning <mithrandirm...@comcast.net>
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-....

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/...

Mully


Erik Veenstra

2/7/2007 3:57:00 PM

0

Please cat your hello-world.rb.

gegroet,
Erik V. - http://www.erikve...


Bernard Kenik

2/7/2007 6:08:00 PM

0

On Feb 7, 10:57 am, "Erik Veenstra" <erikv...@gmail.com> wrote:
> Please cat your hello-world.rb.
>
> gegroet,
> Erik V. -http://www.erikve...

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.


Erik Veenstra

2/11/2007 4:20:00 PM

0

> 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.erikve...

Bernard Kenik

2/11/2007 11:25:00 PM

0

On Feb 11, 11:20 am, "Erik Veenstra" <erikv...@gmail.com> 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.



Erik Veenstra

2/12/2007 9:21:00 AM

0

> 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.erikve...


Bernard Kenik

2/12/2007 4:45:00 PM

0

On Feb 12, 4:21 am, "Erik Veenstra" <erikv...@gmail.com> 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.

Erik Veenstra

2/12/2007 5:33:00 PM

0

require "rubygems"
require "rubyscript2exe"
exit if RUBYSCRIPT2EXE.is_compiling?


Bernard Kenik

2/12/2007 7:16:00 PM

0

On Feb 12, 12:32 pm, "Erik Veenstra" <erikv...@gmail.com> 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.

Richard Manning

2/12/2007 8:36:00 PM

0

Erik Veenstra wrote:
> Please cat your hello-world.rb.
>
> gegroet,
> Erik V. - http://www.erikve...

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-....