Forum: Ruby Ocra build error

Posted by Joel Pearson (virtuoso)
on 2012-11-30 13:38
Attachment: output.txt (2,07 KB)
I'm confused by this, I can't see any reason for Ocra to fail in
building a one-line script.
I've tried disabling all antiviral and active-scan related programs and
reinstalling Ocra to no avail.
The error message really doesn't give me anything to go on as far as I
can see.

Script content:
puts 'Hi'

Ocra build result:
______________________________________________________________
ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
C:\Users\Centrex\Desktop>ocra C:\Users\Centrex\Desktop\test.rb
=== Loading script to check dependencies
Hi
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467: Use
RbConfig instead of obsolete and deprecated Config.
=== Including 52 encoding support files (2831360 bytes, use --no-enc to
exclude)

=== Building test.exe
=== Adding user-supplied source files
=== Adding ruby executable ruby.exe
=== Adding detected DLL C:/Ruby193/bin/libyaml-0-2.dll
=== Adding detected DLL C:/Ruby193/bin/zlib1.dll
=== Adding detected DLL C:/Ruby193/bin/libffi-6.dll
=== Adding library files
=== Compressing 6529206 bytes
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1003:in `block
in initialize': unhandled exception
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:983:in `open'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:983:in
`initialize'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:822:in `new'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:822:in
`build_exe'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1138:in `block
in <top (required)>'
______________________________________________________________
Posted by Joel Pearson (virtuoso)
on 2012-12-01 11:34
I've just completely rebuilt the laptop (fresh install of windows) and 
reinstalled Ruby with Ocra, it still gives the same error! Wtf??
Posted by Joel Pearson (virtuoso)
on 2012-12-01 12:11
This is the line causing the exception:

system("\"#{Ocra.lzmapath}\" e tmpin tmpout 2>NUL") or fail

I have no idea what it's doing.
Posted by Marvin Gülker (quintus)
on 2012-12-01 21:17
Attachment: signature.asc (489 Bytes)
(Received via mailing list)
Am Sat, 1 Dec 2012 20:11:44 +0900
schrieb Joel Pearson <lists@ruby-forum.com>:

> This is the line causing the exception:
>
> system("\"#{Ocra.lzmapath}\" e tmpin tmpout 2>NUL") or fail

This looks as if it invokes the external compression program for LZMA,
which it probably can't find. Try to build your executable with
--disable-lzma. Note however this disables OCRA's compression
facilities and you most likely will end up with a quite large
executable.

You could also file an issue at https://github.com/larsch/ocra/issues
or join the Google group at http://groups.google.com/group/ruby-ocra .
You're more likely to get more specific help over there.

Vale,
Marvin

--
Blog: http://pegasus-alpha.eu/blog

ASCII-Ribbon-Kampagne        ()   | ASCII Ribbon Campaign        ()
- Stoppt HTML-E-Mail         /\   | - Against HTML E-Mail        /\
- Stoppt proprietäre Anhänge      | - Against proprietary attachments
www.asciiribbon.org/index-de.html | www.asciiribbon.org
Posted by Joel Pearson (virtuoso)
on 2012-12-01 23:09
--no-lzma works! That gets me back up and running short-term and gives 
me a direction to start looking in. Thank you so much!
Posted by Joel Pearson (virtuoso)
on 2012-12-02 00:04
Aha, I've cracked it. I previously redirected the command prompt to my 
most commonly used path via a registry entry called Autorun. Since 
that's worked on every other computer I've used without a hitch I didn't 
even think of it until I noticed Ocra's pathing code. That must have 
been affecting the build process because now that I've disabled that key 
value, everything works fine.
I guess the moral is: Playing with the registry may have unforeseen 
consequences!
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.