Can't install/update Psych with Ruby 2.1.4p265 (both x86 and x64) on Windows 8.1 x64
No idea what causes failure.
P:\> gem install psych
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing psych:
ERROR: Failed to build gem native extension.
P:/Ruby21-x64/bin/ruby.exe -r ./siteconf20141108-7796-1pu0oua.rb extconf.rb
checking for yaml.h... no
checking for _WIN32... yes
checking for dlfcn.h... no
checking for inttypes.h... yes
checking for memory.h... yes
checking for stdint.h... yes
checking for stdlib.h... yes
checking for strings.h... yes
checking for string.h... yes
checking for sys/stat.h... *** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=P:/Ruby21-x64/bin/ruby
--with-libyaml-dir
--without-libyaml-dir
--with-libyaml-include
--without-libyaml-include=${libyaml-dir}/include
--with-libyaml-lib
--without-libyaml-lib=${libyaml-dir}/lib
--enable-bundled-libyaml
--disable-bundled-libyaml
P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:395:in `system': Invalid argument - ruby_setenv(USERPROFILE) (Errno::EINVAL)
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:395:in `block in xsystem'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:385:in `xsystem'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:463:in `try_do'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header'
from extconf.rb:28:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in P:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/psych-2.0.6 for inspection.
Results logged to P:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/psych-2.0.6/gem_make.out
At mkmf.rb:395, there's
system(libpath_env, command)
and when inspected libpath_env it seems always to be empty Hash {} so no idea why this fails. To me this looks like it could be a Ruby bug.
This is last entry in log file
"x86_64-w64-mingw32-gcc -E -IP:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IP:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IP:/Ruby21-x64/include/ruby-2.1.0 -I. -I./yaml -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H -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 conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <sys/stat.h>
/* end */