透過Ruby source了解Ruby真理
作者:佚名
Ruby source是一個可以幫助我們理解Ruby語言實質(zhì)性能的幫助工具。在這里我們將會通過對Ruby source的理解來進(jìn)一步提高對Ruby語言的認(rèn)知程度。
Ruby語言的出現(xiàn),為編程人員提供了一個愉悅的編程環(huán)境。在這里我們就通過一段簡單的Ruby source,來看看Ruby語言的基本概念。#t#
1 從rubyforge下載1.85版的src,解壓縮文件到指定目錄下。
2 環(huán)境準(zhǔn)備:我是WindowXp(sp2 jp)+ Cygwin
3 然后打開指定目錄下解壓縮的readme文件,按照步驟運(yùn)行命令。
- * How to compile and install
- This is what you need to do to compile
and install Ruby: - 1. If ./configure does not exist or is older
than configure.in, - run autoconf to (re)generate configure.
- 2. Run ./configure, which will generate
config.h and Makefile. - 3. Edit defines.h if you need. Usually
this step will not be needed. - 4. Remove comment mark(#) before the
module names from ext/Setup (or - add module names if not present),
if you want to link modules - statically.
- If you don't want to compile non
static extension modules - (probably on architectures which does
not allow dynamic loading), - remove comment mark from the
line "#option nodynamic" in - ext/Setup.
- 5. Run make.
- 6. Optionally, run 'make test' to check
whether the compiled Ruby - interpreter works well. If you see
the message "test succeeded", - your ruby works as it should (hopefully).
- 7. Run 'make install'
- You may have to be a super user to install ruby.
編譯成功,在usr/local/下面生成了編譯后的文件。
責(zé)任編輯:曹凱
來源:
博客園