Forum: Ruby Problems with Zlib::Inflate.inflate

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris Malek (Guest)
on 2006-01-13 09:40
(Received via mailing list)
I am running on windows xp and trying to inflate a string and decode
it.  I am getting a

When I try to execute this script I get the following error:

deflateBase64.rb:11: uninitialized constant Zlib (NameError)


Ruby Version: 1.8.2


##########################################
require 'base64'
f = File.open("c:/temp/string.txt","r")
fout = File.open("c:/temp/decodedString","w")
fout.puts(Zlib::VERSION )
while (ln = f.gets)
     inflatedString  = Zlib::Inflate.inflate ln
     decodeString = Base64.decode64(inflatedString)
     fout.puts(decodeString)
     f.close
     fout.puts("closing")
      fout.close


end

##########################################




Anyone have any idea?

Thanks in advance.
Adam S. (Guest)
on 2006-01-13 09:45
(Received via mailing list)
require 'zlib' , maybe.
This topic is locked and can not be replied to.