摘要: Ruby使用DBI连接MySQL数据库一般为:require "dbi"dbh = DBI.connect("dbi:Mysql:test:localhost", "root", "123456")dbh.disconnect if dbh 但是当mysql数据库端口改变时,如果直接在“dbi:Mysql:test:localhost”后面加上端口号,如“dbi:Mysql:test:localhost:10086”,将出现错误代码为2003的异常:C:/Ruby193/lib/ruby/gems/1.9.1/ge 阅读全文
posted @ 2014-03-09 18:36 丶小青豆丶 阅读(575) 评论(0) 推荐(0) 编辑
摘要: #初始化a = Array.newp a #=>[]a = Array.new(5)p a #=>[nil, nil, nil, nil, nil]a = Array.new(5,0)p a #=>[0, 0, 0, 0, 0]city = ["北京", "上海", "广州"] p city #=> ["北京", ... 阅读全文
posted @ 2014-03-04 14:39 丶小青豆丶 阅读(6826) 评论(0) 推荐(0) 编辑
摘要: 安卓模拟器的报错:可能的原因是target设置问题: 阅读全文
posted @ 2014-02-28 14:29 丶小青豆丶 阅读(485) 评论(0) 推荐(0) 编辑