2012 年五月 一 二 三 四 五 六 日 « 四 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 分类
- Actionscript (3)
- Git (3)
- Javascript (1)
- Life (30)
- Mac OS (6)
- PHP (3)
- Python (1)
- Ruby (2)
- Server (9)
标签
Category Archives: Ruby
Ruby 工作笔记
在1.9中,Iconv#iconv已经不推荐使用,请用String#encode(!)替代 标准库一般都为小写,require ”, pkg must be lowcase 读取utf-8页面报无效字符错误时,执行String#.force_encoding ‘utf-8′即可,其他编码参考处理 格式化时间Time.now.strftime(‘%Y-%m-%d %H:%i’) 要以module::method的方式调用方法时,方法名前面要加self.,表示是实例方法 ruby的主文件为 $0 改变工作目录 Dir.chdir File.dirname(__FILE__)
Posted in Ruby
Leave a comment
Mac 下使用 rvm 安装 ree 报段错误
背景 系统版本:Mac OS X Lion 使用 rvm install ree 报错:./ext/purelib.rb:2: [BUG] Segmentation fault 解决方法 export CC=/usr/bin/gcc-4.2 如果还是无法安装,请尝试先 rvm remove ree 后再行安装,即: rvm remove ree export CC=/usr/bin/gcc-4.2 rvm install ree 参考 《Segmentation fault in (RVM) REE installation》 《Segmentation fault while installing … Continue reading
Posted in Mac OS, Ruby
Leave a comment