透过Ruby source了解Ruby真理

开发 开发工具
Ruby source是一个可以帮助我们理解Ruby语言实质性能的帮助工具。在这里我们将会通过对Ruby source的理解来进一步提高对Ruby语言的认知程度。

Ruby语言的出现,为编程人员提供了一个愉悦的编程环境。在这里我们就通过一段简单的Ruby source,来看看Ruby语言的基本概念。#t#

1 从rubyforge下载1.85版的src,解压缩文件到指定目录下。

2 环境准备:我是WindowXp(sp2 jp)+ Cygwin

3 然后打开指定目录下解压缩的readme文件,按照步骤运行命令。
 

  1. * How to compile and install  
  2. This is what you need to do to compile 
    and install Ruby:  
  3.  
  4. 1. If ./configure does not exist or is older 
    than configure.in,  
  5. run autoconf to (re)generate configure.  
  6.  
  7. 2. Run ./configure, which will generate 
    config.h and Makefile.  
  8.  
  9. 3. Edit defines.h if you need. Usually 
    this step will not be needed.  
  10.  
  11. 4. Remove comment mark(#) before the 
    module names from ext/Setup (or  
  12. add module names if not present), 
    if you want to link modules  
  13. statically.  
  14. If you don't want to compile non 
    static extension modules  
  15. (probably on architectures which does 
    not allow dynamic loading),  
  16. remove comment mark from the
     line "#option nodynamic" in  
  17. ext/Setup.  
  18.  
  19. 5. Run make.  
  20.  
  21. 6. Optionally, run 'make test' to check
     whether the compiled Ruby  
  22. interpreter works well. If you see 
    the message "test succeeded",  
  23. your ruby works as it should (hopefully).  
  24.  
  25. 7. Run 'make install'  
  26. You may have to be a super user to install ruby. 

 

编译成功,在usr/local/下面生成了编译后的文件。
 

责任编辑:曹凯 来源: 博客园
相关推荐

2009-12-18 11:37:54

Ruby关键字yiel

2009-12-15 17:28:11

Ruby自动化脚本框架

2022-02-23 09:36:11

GoRuby编程语言

2009-08-27 10:21:22

Ruby on Rai

2014-11-05 11:05:15

Ruby

2011-04-18 09:53:08

Ruby

2009-09-09 17:45:25

Ruby的blocks

2009-12-15 11:01:31

Ruby数组

2009-12-15 14:16:13

Ruby Contin

2009-12-14 13:47:28

Ruby简单语法

2009-12-14 15:04:32

Ruby性能特点

2009-12-14 13:56:12

Ruby特点

2012-11-07 09:41:30

2009-12-14 09:33:04

Ruby安装

2009-12-15 10:23:23

Ruby应用技巧

2009-12-15 15:28:22

Ruby重载

2009-08-06 09:13:36

Ruby on Rai

2009-12-15 15:35:56

Ruby symbol

2009-12-14 11:12:55

Ruby运行

2009-12-16 14:51:26

Ruby nil
点赞
收藏

51CTO技术栈公众号