IronRuby, RubyZip and ZLib == error

Hello,

Just tried to use RubyZip with IronRuby (porting a rake task onto
irake) and I received the following error:

rake aborted!
wrong number of arguments (2 for 0)
c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1073:in
initialize' c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1000:inget_compressor’
c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:995:in
init_next_entry' c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:957:input_next_entry’
c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:803:in
write_to_zip_output_stream' c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1482:incommit’
c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1123:in
each' c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1482:incommit’
c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:937:in
open' c:/ironruby/lib/ironruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1479:incommit’

Line of code is: @zlibDeflater = Zlib::Deflate.new(level,
-Zlib::MAX_WBITS)

Method:
def initialize(outputStream, level = Zlib::DEFAULT_COMPRESSION)
super()
@outputStream = outputStream
@zlibDeflater = Zlib::Deflate.new(level, -Zlib::MAX_WBITS)
@size = 0
@crc = Zlib::crc32
end

Any ideas what is causing the problem?

My IronRuby version is irb 0.9.5(05/04/13)

Thanks

Ben

Hi Benz,
IronRuby has Standard zlib built-in. Can you try this?

require ‘zlib’

z = Zlib::Deflate.new
dst = z.deflate(‘foo’, Zlib::FINISH)

Hope this helps,
-Jirapong

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs