最近在看ruby hacking guide (ruby源代码完全解说,Rubyソースコード完全解説)这本书。

看到网上有团队在翻译,可惜没有搜索到翻译好成果物,只好继续看日文版的原文了。

从大一开始就学习c了,这么多年除了学习,还没有真正使用过c来开发项目。
正好可以通过看ruby source来了解一下其中奥妙。

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

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

3 然后打开指定目录下解压缩的readme文件,按照步骤运行命令。
 
编译ruby source* How to compile and install
编译ruby source
编译ruby sourceThis is what you need to do to compile and install Ruby:
编译ruby source
编译ruby source  
1. If ./configure does not exist or is older than configure.in,
编译ruby source     run autoconf to (re)generate configure.
编译ruby source
编译ruby source  
2. Run ./configure, which will generate config.h and Makefile.
编译ruby source
编译ruby source  
3. Edit defines.h if you need.  Usually this step will not be needed.
编译ruby source
编译ruby source  
4. Remove comment mark(#) before the module names from ext/Setup (or
编译ruby source     add module names if not present)
, if you want to link modules
编译ruby source     statically.
编译ruby source
编译ruby source     If you don't want to compile non static extension modules
编译ruby source     (probably on architectures which does not allow dynamic loading)
,
编译ruby source     remove comment mark from the line 
"#option nodynamic" in
编译ruby source     ext/Setup.
编译ruby source
编译ruby source  
5. Run make.
编译ruby source
编译ruby source  
6. Optionally, run 'make test' to check whether the compiled Ruby
编译ruby source     interpreter works well.  If you see the message 
"test succeeded",
编译ruby source     your ruby works as it should (hopefully).
编译ruby source
编译ruby source  
7. Run 'make install'
编译ruby source
编译ruby source     You may have to be a super user to install ruby.

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

相关文章: