$ cat test.rb
p Marshal.load(Marshal.dump(‘hello world’))
a = File.new(‘test’, ‘w’)
Marshal.dump(‘hello world’, a)
b = Marshal.load(‘test’)
p b
$ ruby test.rb
"hello world"
test.rb:4:in `load’: incompatible marshal file format (can’t be read) (TypeError)
format version 4.8 required; 116.101 given
from test.rb:4
svg% ri Marshal::load
---------------------------------------------------------- Marshal::load
load( from [, aProc] ) -> anObject
···
------------------------------------------------------------------------
Returns the result of converting the serialized data in from into a
Ruby object (possibly with associated subordinate objects). from
may be either an instance of IO or an object that responds to
to_str. If proc is specified, it will be passed each object as it
is deserialized.