# Wrong argument type String (expected Data) (TypeError) on 1.8 with dl

**URL:** <https://www.ruby-forum.com/t/wrong-argument-type-string-expected-data-typeerror-on-1-8-with-dl/156433>\
**Category:** Development\
**Created:** [December 27, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/wrong-argument-type-string-expected-data-typeerror-on-1-8-with-dl/156433 "2008-12-27T14:06:23Z")\
**Posts on this page:** 1\
**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:** [December 27, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/wrong-argument-type-string-expected-data-typeerror-on-1-8-with-dl/156433/1 "2008-12-27T14:06:23Z")

</div>

1.8 e$B$G$H$-$\*$je(B RubySpec e$B$,Mn$A$k$N$G!"e(B  
[http://www.rubyist.net/~akr/chkbuild/debian/ruby-1.8/log/20081227T205959.txt.gz](http://www.rubyist.net/~akr/chkbuild/debian/ruby-1.8/log/20081227T205959.txt.gz)  
e$B$A$g$C$H$_$F$_$?$ie(B DL e$B$r;H$C$F$^$7$?!#e(B

e$B:F8=$G$-$k$+;n$7$?$H$3$m!“$H$j$”$($:0J2\<$N$h$&$K$9$k$He(B  
-e:7:in `[]': wrong argument type String (expected Data) (TypeError)  
e$B$H$$$&%(%i!\<$,=P$k$h$&$G$9!#e(B

% ./ruby -rdl -ve ’  
GC.stress = true  
10.times {  
ptr = [“ABC”].pack(“p”)  
addr = ptr.unpack(“L”).first  
dptr = DL::PtrData.new(addr, 1)  
p dptr[0,1]  
}  
’  
ruby 1.8.7 (2008-12-21 revision 20895) [i686-linux]  
“A”  
-e:7:in `[]': wrong argument type String (expected Data) (TypeError) from -e:7 from -e:3:in `times’  
from -e:3
