Re: Trouble with Marshal

From: Gavin K.

p s2 = Marshal.load( ‘desc.marshal’ ) )

#=> foo.rb:13:in `load’: marshal data too short (ArgumentError)

Bah, my stupid fault. It was binary mode at stake, but on reading, not
writing. Mauricio Fernández kindly pointed out my error. Changing the
above to… ‘desc.marshal’, ‘rb’ ){ |f| @s2 = Marshal.load( ) }
…fixed my problem.

Thanks for the help, sorry for the noise.

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