---
title: "ruby1.8 1.9问题"
author: "yangbinfc"
date: "2011-02-15T11:38:00Z"
tags: []
slug: "ruby1-8-1-9"
draft: false
lastmod: "2012-11-04T17:47:54Z"
id: 1715374
url: "https://yangbinfc.iteye.com/blog/1715374"
---

1：正式的参数不能使实例变量

Ruby1.8

Ruby1.9

2：覆盖外部局部变量

3: hash语法 ” , “ 问题

ruby 1.8 {"a","b"} =&gt; {"a"=&gt; "b"}

ruby 1.9 {"a" =&gt;＂ｂ＂}

４：字符

默认是 US-ASCIi 码 如果不是的话 用 coding :utf-8

5: String的 ‘to\_a’方法未定义

1.8 : string.to\_a

1.9 : string.lines.to\_a

为了解决兼容性问题keyi :

6: 关键字 then , ; /n case if 可以使用： 代替

1.8:

1.9:

7:no such file to load -base64:

8:'结构体 RStirng没有成员‘ptr’ len

9:成员改变从Strings转化到Symbols

10：TypeErro：不能分配nil；要用Hash#delete 代替