Compilation and installation from ruby source code in win7, and win7ruby source code compilation
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 the ruby 2.4.1 version from the official website, the https://www.ruby-lang.org/en/downloads/ from the installation guide can be seen, the official only provides the linux platform for the compilation and installation steps, the https://www.ruby-lang.org/en/documentation/installation/#building-from-source and the operations performed in windows slightly different, 1. go to the downloaded ruby root directory and execute win32 \ configure. bat i686-mswin32 2. run nmake 3. run nmake rubyw.exe 4. run the namke test command to check whether the ruby executable file has been generated after the test is executed. You need to install the file in the target path. For example, C: \ opt \ ruby, run the following command: 5. nmake DESTDIR = C: \ opt \ ruby install C: \ opt \ ruby \ bin is added to the PATH variable to complete ruby compilation and installation.