Ocra just stopped working with webdriver

This code functions fine from a script, but when I try to package it
with Ocra I get an error…
ruby 1.9.3
watir-webdriver 0.6.1
ocra 1.3.0
Platform: Windows 7 64-bit


Ruby Code:


require ‘watir-webdriver’

testy = Watir::Browser.new
testy.goto(“www.purple.com”)
testy.quit
puts “Complete”
exit


Console output:


C:\Users\test\Desktop>ocra driver.rb
=== Loading script to check dependencies
Complete
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467: Use
RbConfig instea
d of obsolete and deprecated Config.
C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressable/idna/pure.
rb:323:in load': marshal data too short (ArgumentError) from C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab le/idna/pure.rb:323:inblock in module:IDNA
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab
le/idna/pure.rb:322:in open' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab le/idna/pure.rb:322:inmodule:IDNA
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab
le/idna/pure.rb:20:in <module:Addressable>' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab le/idna/pure.rb:19:in<top (required)>’
from
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i nrequire’
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab
le/idna.rb:24:in rescue in <top (required)>' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab le/idna.rb:19:in<top (required)>’
from
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i nrequire’
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.1/lib/addressab
le/uri.rb:20:in <top (required)>' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:i nrequire’
from
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:i
n require' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libwebsocket-0.1.3/lib/libwebso cket/url.rb:1:in<top (required)>’
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:in con st_get' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:inblo
ck (3 levels) in attempt_load_autoload’
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:in eac h' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:inblo
ck (2 levels) in attempt_load_autoload’
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:462:in eac h' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:462:inblo
ck in attempt_load_autoload’
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:456:in loo p' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:456:inatt
empt_load_autoload’
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:679:in bui ld_exe' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1138:inbl
ock in <top (required)>’

C:\Users\test\Desktop>

You are probably switching ruby versions and reading incompatible
marshal files?

See what file this is trying to read and go from there.

All the paths referenced in the error messages are Ruby193, this should
be right.
I didn’t require libwebsocket or addressable, so I assume they’re
dependencies of webdriver.
The odd thing is this started happening without apparent cause. I hadn’t
changed any revisions or done any updates, and now even older working
versions won’t compile with webdriver.

On Jul 23, 2012, at 11:32 , Joel P. wrote:

All the paths referenced in the error messages are Ruby193, this should
be right.
I didn’t require libwebsocket or addressable, so I assume they’re
dependencies of webdriver.
The odd thing is this started happening without apparent cause. I hadn’t
changed any revisions or done any updates, and now even older working
versions won’t compile with webdriver.

I’m asking you to look into this:

https://github.com/sporkmonger/addressable/blob/master/lib/addressable/idna/pure.rb#L323

Thank you for your help. I have downgraded to addressable 2.2.8 and ocra
now works with webdriver again.

Just to document what it took… I had to make sure that the latest
versions of addressable available to ocra was 2.2.8 and libwebsocket was
0.1.3, and I had to require libwebsocket in the code.

Ryan D. wrote in post #1069864:

I’m asking you to look into this:

https://github.com/sporkmonger/addressable/blob/master/lib/addressable/idna/pure.rb#L323

There is a clear problem with that.

On Windows, files are open in text mode by default.

Dunno what UNICODE_TABLE is, but if is a binary file, the file needs to
be open with “rb” mode instead.

Definitely is a portability bug of addressable gem.


Luis lavena