How to compile and install ruby source code in win7, and how to compile win7ruby source code

Source: Internet
Author: User

How to compile and install ruby source code in win7, and how to compile win7ruby source code

At work, we need to embed ruby c api in c ++ Code. However, compilation fails in the vs project, so we can find the reason by manually compiling ruby from the source code (previously installed using rubyinstaller ).

First download ruby 2.4.1 from the official website, https://www.ruby-lang.org/en/downloads/

From the installation guide, we can see that the official only provides the compilation and installation steps under the linux platform, https://www.ruby-lang.org/en/documentation/installation/#building-from-source

The operations performed in windows are slightly different, as described below:

1. Go to the downloaded ruby root directory and execute the win32 \ configure. bat i686-mswin32

2. Execute nmake

3. Run nmake rubyw.exe.

4. Run namke test to check whether the test is successful.

After the execution is complete, the ruby executable file has been generated and needs to be installed to the target path. For example, C: \ opt \ ruby, run the following command:

5. nmake DESTDIR = C: \ opt \ ruby install

After the execution is complete, add C: \ opt \ ruby \ bin to the PATH variable to complete ruby compilation and installation.

The above method for compiling and installing ruby source code in win7 is all the content that I have shared with you. I hope you can give us a reference and support for more.

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.