Compile Ruby Source

Source: Internet
Author: User
Tags hacking guide
Recently, I am reading the ruby hacking Guide (the ruby source code is completely explained, and the ruby hacker has been fully explained.

I saw a team translating on the Internet. Unfortunately, I didn't find any good translation results, so I had to continue reading the original Japanese version.

I learned C from my freshman year. After so many years of learning, I have not actually used C for project development.
You can take a look at Ruby source to find out the details.

1. Download the 1.85 version of SRC from rubyforge and extract the file to the specified directory.

2. Environment preparation: Windows XP (SP2 JP) + cygwin

3. Open the decompressed readme file in the specified directory and run the command according to the steps.
 

* 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 ubuntures 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 shound (hopefully ).

7. Run 'make install'

You may have to be a Super User to install Ruby.

The compiled file is generated under usr/local.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.