Mo'men Mohamed
Mo'men Mohamed

Reputation: 21

How to Compile Ruby on Windows?

linking miniruby.exe
win32.obj : error LNK2001: unresolved external symbol __imp____pioinfo
miniruby.exe : fatal error  LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.rel

This is the error in cmd while compiling the package using Development cmd for VS2015.
What is wrong?

Upvotes: 2

Views: 3110

Answers (3)

dvijayak
dvijayak

Reputation: 13

I ran into the same error (minus some printed output differences) when trying to compile Ruby 2.5.1 on Windows using Visual Studio 2015 Express. I thought that all I needed to do was to add the bin directory to my PATH. So I did this and then tried building but I failed:

$> cd <path_to_ruby_download>
$> set PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;%PATH%
$> win32\configure.bat

I was able to get past this problem thanks to some insight from this attempt. The main hint (from jules_a) is:

Looks like cl.exe cannot be found. You should use vcvarsall.bat to configure your path properly.

I tried searching for this vcvarsall batch file but couldn't find it in my Visual Studio installation directory. However, thanks to this article, I found another way. Turns out that all I needed to do was to build from a developer console.

On my computer, I could start this dev console by going to Start -> All Programs -> Visual Studio 2015 -> Visual Studio Tools -> Developer Command Prompt for VS2015. Alternatively, you can launch VsDevCmd.bat, located in Common7\Tools\ directory of your Visual Studio installation.

And then everything worked! Note that I did not need to bother with RubyInstaller or any of that jazz!

Upvotes: 1

suhao399
suhao399

Reputation: 648

For downloading ruby

I am not sure if you still need the answer, I also see that rubyinstaller does not have new ruby release also. After asking around for a while I found that they are posting new release at github. I downloaded 2.4.1 and it work for me.

https://github.com/oneclick/rubyinstaller2/releases

For compiling ruby

Please read this link so you will have info. they change to use msys2 and mingw now

https://github.com/oneclick/rubyinstaller2/

Upvotes: 0

Jeremy
Jeremy

Reputation: 1002

You want to compile it or install it? Because you don't need to compile it if you just want to install it. Check the binaries

http://rubyinstaller.org/

Upvotes: 0

Related Questions