在一台电脑上我在 ruby 1.8.6 上得到这个,在另一台电脑上我得到错误
irb(main):001:0> buff = "12345678"
=> "12345678"
irb(main):002:0> buff[4] =0x30
=> 48
irb(main):003:0> buff
=> "12340678"
irb(main):004:0> @new0 = "123456789"
=> "123456789"
irb(main):005:0> @new0[4] = 0x30
=> 48
> @buff ="123456789"
=> "123456789"
> @buff
=> "123456789"
> @buff[4]= 0x30
TypeError: can't convert Fixnum into String
from (irb):3:in `[]='
from (irb):3
> @buff[4] = 0x30