Use File.binread instead of File.read(:mode=>'rb')