Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > RubyScript2EXE Not Functioning

Reply
Thread Tools

RubyScript2EXE Not Functioning

 
 
Richard Manning
Guest
Posts: n/a
 
      02-07-2007
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/.

 
Reply With Quote
 
 
 
 
mully
Guest
Posts: n/a
 
      02-07-2007
On Feb 6, 10:16 pm, Richard Manning <(E-Mail Removed)>
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


 
Reply With Quote
 
 
 
 
Erik Veenstra
Guest
Posts: n/a
 
      02-07-2007
Please cat your hello-world.rb.

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


 
Reply With Quote
 
bbiker
Guest
Posts: n/a
 
      02-07-2007
On Feb 7, 10:57 am, "Erik Veenstra" <(E-Mail Removed)> 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.


 
Reply With Quote
 
Erik Veenstra
Guest
Posts: n/a
 
      02-11-2007
> 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/

 
Reply With Quote
 
bbiker
Guest
Posts: n/a
 
      02-11-2007
On Feb 11, 11:20 am, "Erik Veenstra" <(E-Mail Removed)> 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.



 
Reply With Quote
 
Erik Veenstra
Guest
Posts: n/a
 
      02-12-2007
> 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/


 
Reply With Quote
 
bbiker
Guest
Posts: n/a
 
      02-12-2007
On Feb 12, 4:21 am, "Erik Veenstra" <(E-Mail Removed)> 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.

 
Reply With Quote
 
Erik Veenstra
Guest
Posts: n/a
 
      02-12-2007
require "rubygems"
require "rubyscript2exe"
exit if RUBYSCRIPT2EXE.is_compiling?


 
Reply With Quote
 
bbiker
Guest
Posts: n/a
 
      02-12-2007
On Feb 12, 12:32 pm, "Erik Veenstra" <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cisco 7200 Console port not functioning mdk@iping.org Cisco 5 05-26-2005 03:04 AM
Active FTP on PIX not functioning valicon Cisco 1 04-08-2005 03:41 AM
dropdownlist user control not functioning propetly surveyor04 ASP .Net 0 02-12-2005 02:50 AM
Enable property of a Panel not functioning =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= ASP .Net 0 02-07-2005 11:43 AM
RequiredFieldValidators client-side script not functioning with Windows Server 2003 sadf ASP .Net 4 11-14-2003 03:16 PM



Advertisments