Can't install/update Psych with Ruby 2.1.4p265 (both x86 and x64)

517 views
Skip to first unread message

Dāvis Mosāns

unread,
Nov 7, 2014, 5:38:45 PM11/7/14
to rubyin...@googlegroups.com
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 */

Dāvis Mosāns

unread,
Nov 7, 2014, 5:49:02 PM11/7/14
to rubyin...@googlegroups.com
is there some monkey-patching involved regarding gem compilation?
when I replaced mkmf.rb system(libpath_env, command) to system({}, command) it still failed with same error, but changing to system(command) it worked fine and successfully installed psych.

Luis Lavena

unread,
Nov 7, 2014, 5:58:21 PM11/7/14
to rubyin...@googlegroups.com
Hello Davis,

On Fri, Nov 7, 2014 at 7:49 PM, Dāvis Mosāns <davi...@gmail.com> wrote:
is there some monkey-patching involved regarding gem compilation?
when I replaced mkmf.rb system(libpath_env, command) to system({}, command) it still failed with same error, but changing to system(command) it worked fine and successfully installed psych.


mkmf do stuff that is not very clear.

This happens with every gem you attempt to install? Can you try something like oj or ox gems?

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Dāvis Mosāns

unread,
Nov 7, 2014, 8:06:45 PM11/7/14
to rubyin...@googlegroups.com
sestdiena, 2014. gada 8. novembris 00:58:21 UTC+2, Luis Lavena rakstīja:
Hello Davis,

On Fri, Nov 7, 2014 at 7:49 PM, Dāvis Mosāns <davi...@gmail.com> wrote:
is there some monkey-patching involved regarding gem compilation?
when I replaced mkmf.rb system(libpath_env, command) to system({}, command) it still failed with same error, but changing to system(command) it worked fine and successfully installed psych.


mkmf do stuff that is not very clear.

This happens with every gem you attempt to install? Can you try something like oj or ox gems?


No, It happens only for Psych. No problems for any other gems. I tried these: bigdecimal, json, nokogiri, oj, ox and they all compiled and installed successfully while Psych fails. Really weird.

 

Dāvis Mosāns

unread,
Nov 28, 2014, 10:32:33 PM11/28/14
to rubyin...@googlegroups.com

okay, so it actually does happen on other gems too. Now I tried faye-websocket and it failed same as Psych, but weird that oj and ox does work.
 
 

Dāvis Mosāns

unread,
Nov 28, 2014, 10:34:29 PM11/28/14
to rubyin...@googlegroups.com
forgot to tell, it happens on ruby 2.1.5p273 too


P:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:395:in `system': Invalid argument - ruby_setenv(USERPROFILE) (Errno::EINVAL)

Reply all
Reply to author
Forward
0 new messages