Couldn't install http-cookie gem

Kirill's Avatar


26 Jan, 2018 11:49 PM

Good day!
I am very new in Ruby. I need just to execute one .rb file but it needs a lot of additional libraries. Some of them were installed but I have problems with http-cookie. It says:

$>gem install -http-proxy http://myproxy:8888 http-cookie
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing http-cookie:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/unf_ext-
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180126-8844-1titamy.rb extconf.rb
checking for -lstdc++... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to gen
erate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:542:in `try_link0'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:557:in `try_link'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:775:in `try_func'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1002:in `block in have_library
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'

        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in po
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
        from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:997:in `have_library'
        from extconf.rb:6:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can
 be found here:


extconf failed, exit code 1

Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/unf_ex
t- for inspection.
Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0

I used Rubygems v2.7.4.

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32 -IC:/Ruby24-x64/include/ruby-2.4.0/ruby/backward -IC:/Ruby24-x64/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby24-x64/lib -L. -pipe -lx64-msvcrt-ruby240 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */

Please help with any advice!
Thanks you in advance!

  1. Support Staff 1 Posted by kerrizor on 27 Jan, 2018 12:15 AM

    kerrizor's Avatar

    Hello! Sorry you're having trouble here! In general, we offer support only for the service; we can't really debug individual user's personal machines.

    That said, reading the error, it says "You have to install development tools first. " It looks like you're on a Windows machine, which I'm sorry to say I personally don't have any real experience with (at least, not in the last 5 years!) I did find this one article from a quick google search:

    I hope this helps at least get you started!

  2. kerrizor closed this discussion on 27 Jan, 2018 12:15 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac