Problems with Zlib::Inflate.inflate


#1

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.


#2

require ‘zlib’ , maybe.