0

When I try to running bundle install I see:

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

C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/extensions/x86-
mingw32/2.3.0/nio4r-2.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/nio4r-2.1.0 for 
inspection.
Results logged to
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/extensions/x86-
mingw32/2.3.0/nio4r-2.1.0/gem_make.out

An error occurred while installing nio4r (2.1.0), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.1.0'` succeeds before bundling.

I am using Windows 10, Ruby 2.3.3, Rails 5.0.2.

mkmf.log content is:

"gcc -o conftest.exe -IC:/RailsInstaller/Ruby2.3.0/include/ruby-2.3.0/i386-
mingw32 -IC:/RailsInstaller/Ruby2.3.0/include/ruby-2.3.0/ruby/backward -
IC:/RailsInstaller/Ruby2.3.0/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -
D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -
O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-
parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -
Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-
statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-
packed-bitfield-compat conftest.c  -L. -LC:/RailsInstaller/Ruby2.3.0/lib -L.      
-lmsvcrt-ruby230  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "

Checked program was:

#include "ruby.h"

#include <winsock2.h>
#include <windows.h>
int main(int argc, char **argv)
{
  return 0;
}
Robin Daugherty
  • 7,115
  • 4
  • 45
  • 59
  • Running `gem install nio4r -v '2.1.0'` also shows an error? – Gerry Jun 04 '17 at 00:59
  • It'd be helpful for us to help you if provide as much info as possible while posting the question, what is the content of your mkmf.log file, which should give some info on the error – Subash Jun 04 '17 at 04:22
  • Yes, I am running gem install nio4r -v '2.1.0' and same error show me – BASSAM A. Muhajjar Jun 05 '17 at 08:24
  • It would be helpful if you provide the contents of `mkmf.log`, located in `C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/extensions/x86- mingw32/2.3.0/nio4r-2.1.0/` – Wikiti Jun 05 '17 at 10:03

1 Answers1

1

If other gems have same error (and it's initial bundle install), try to change in gemfile source 'https://rubygems.org' to source 'http://rubygems.org'.

I had this problem on windows in corporate network, and problem somewhere with ssl. That solution works for me, but i know, it isn't best solution.

But it's a bad recommendation, if any other gem installed with success.

Фил
  • 71
  • 4