# \`Marshal#load': incompatible marshal file format (can't be r

**URL:** <https://www.ruby-forum.com/t/marshal-load-incompatible-marshal-file-format-cant-be-r/102374>\
**Category:** Development\
**Created:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/marshal-load-incompatible-marshal-file-format-cant-be-r/102374 "2006-08-15T14:16:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/marshal-load-incompatible-marshal-file-format-cant-be-r/102374/1 "2006-08-15T14:16:33Z")

</div>

e$B0J2\<$N$h$&$K!“e(BMarshal e$B$Ge(B dump e$B$7$?7k2L$,e(B load  
e$B$G$-$J$$$3$H$,$”$k$h$&$G$9!#e(B

% ./ruby -e ‘Marshal.dump(0, STDOUT)’|./ruby -ve ‘Marshal.load(STDIN)’  
ruby 1.9.0 (2006-08-09) [i686-linux]  
-e:1:in `Marshal#load’: incompatible marshal file format (can’t be read)  
(TypeError)  
format version 4.8 required; 52.42 given from -e:1

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/marshal-load-incompatible-marshal-file-format-cant-be-r/102374/2 "2006-08-15T14:16:33Z")

</div>

e$B$J$+$@$G$9!#e(B

At Fri, 11 Aug 2006 19:34:17 +0900,  
Tanaka A. wrote in [ruby-dev:29255]:

> e$B0J2\<$N$h$&$K!“e(BMarshal e$B$Ge(B dump e$B$7$?7k2L$,e(B load e$B$G$-$J$$$3$H$,$”$k$h$&$G$9!#e(B
> 
> % ./ruby -e ‘Marshal.dump(0, STDOUT)’|./ruby -ve ‘Marshal.load(STDIN)’  
> ruby 1.9.0 (2006-08-09) [i686-linux]  
> -e:1:in `Marshal#load’: incompatible marshal file format (can’t be read) (TypeError)  
> format version 4.8 required; 52.42 given from -e:1

SIZEOF\_INT == SIZEOF\_LONG  
e$B$@$H!"e(BFIX2INTe$B$H$+$O$J$s$K$b%A%’%C%/$7e(B  
e$B$J$$$s$G$9$h$M$’!#e(B

# Index: marshal.c

RCS file: /cvs/ruby/src/ruby/marshal.c,v  
retrieving revision 1.126  
diff -p -U 2 -r1.126 marshal.c  
— marshal.c 9 Jun 2006 21:20:12 -0000 1.126  
+++ marshal.c 11 Aug 2006 10:51:50 -0000  
@@ -758,5 +758,5 @@ r\_byte(struct load\_arg \*arg)  
VALUE v = rb\_funcall2(src, s\_getc, 0, 0);  
if (NIL\_P(v)) rb\_eof\_error();

- c = (unsigned char)FIX2INT(v);

- c = (unsigned char)NUM2CHR(v);  
}  
return c;
