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.