ruby-debug / debase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fails to install on win10

lumean opened this issue · comments

Hi,
I tried to install on windows 10 with ruby 2.2.5 and devkit, but it fails building native extension, do you have any suggestions? (I already tried the beta with --pre but get the same error)

c:\ruby\DevKit-32-4.7.2-1151>ruby dk.rb install -f
[WARN] Updating (with backup) existing gem override for 'C:/ruby/ruby223-p173'
[WARN] Updating (with backup) DevKit helper library for 'C:/ruby/ruby223-p173'
[WARN] Updating (with backup) existing gem override for 'C:/ruby/ruby225-p319'
[WARN] Updating (with backup) DevKit helper library for 'C:/ruby/ruby225-p319'

c:\ruby\DevKit-32-4.7.2-1151>gem install debase
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing debase:
        ERROR: Failed to build gem native extension.

    current directory: c:/ruby/ruby225-p319/lib/ruby/gems/2.2.0/gems/debase-0.2.1/ext
c:/ruby/ruby225-p319/bin/ruby.exe -r ./siteconf20170127-7212-p3skit.rb extconf.rb
checking for vm_core.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=c:/ruby/ruby225-p319/bin/$(RUBY_BASE_NAME)
        --with-ruby-dir
        --without-ruby-dir
        --with-ruby-include
        --without-ruby-include=${ruby-dir}/include
        --with-ruby-lib
        --without-ruby-lib=${ruby-dir}/lib
c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:321:in `open'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:321:in `open'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
        from c:/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
        from extconf.rb:31:in `block in <main>'
        from c:/ruby/ruby225-p319/lib/ruby/gems/2.2.0/gems/debase-ruby_core_source-0.9.6/lib/debase/ruby_core_source.rb:15:in `call'
        from c:/ruby/ruby225-p319/lib/ruby/gems/2.2.0/gems/debase-ruby_core_source-0.9.6/lib/debase/ruby_core_source.rb:15:in `create_makefile_with_core'
        from extconf.rb:47:in `<main>'

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

  c:/ruby/ruby225-p319/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/debase-0.2.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in c:/ruby/ruby225-p319/lib/ruby/gems/2.2.0/gems/debase-0.2.1 for inspection.
Results logged to c:/ruby/ruby225-p319/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/debase-0.2.1/gem_make.out

Contents of mkmf.log:

"gcc -o conftest.exe -Ic:/ruby/ruby225-p319/include/ruby-2.2.0/i386-mingw32 -Ic:/ruby/ruby225-p319/include/ruby-2.2.0/ruby/backward -Ic:/ruby/ruby225-p319/include/ruby-2.2.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:/ruby/ruby225-p319/lib -L.      -lmsvcrt-ruby220  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

I also tried installing the gem debase-ruby_core_source first, but this did not help either.

@lumean please provide output of ruby -v

D:\>ruby -v
ruby 2.2.5p319 (2016-04-26 revision 54774) [i386-mingw32]

is there anything I can try on my side to further debug the issue? I have managed to manually create the make file and compile it on my machine, so in general the devkit installation should be fine. Note the error I get when I try to manually create the makefile without -rdevkit is quite similar to the one I get above during gem install

D:\Anwendungen\ruby\ruby225-p319\lib\ruby\gems\2.2.0\gems\debase-0.2.1\ext>ruby extconf.rb
checking for vm_core.h... D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:321:in `open'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:321:in `open'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
        from extconf.rb:31:in `block in <main>'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/gems/2.2.0/gems/debase-ruby_core_source-0.9.6/lib/debase/ruby_core_source.rb:15:in `call'
        from D:/Anwendungen/ruby/ruby225-p319/lib/ruby/gems/2.2.0/gems/debase-ruby_core_source-0.9.6/lib/debase/ruby_core_source.rb:15:in `create_makefile_with_core'
        from extconf.rb:47:in `<main>'

D:\Anwendungen\ruby\ruby225-p319\lib\ruby\gems\2.2.0\gems\debase-0.2.1\ext>ruby -rdevkit extconf.rb
Temporarily enhancing PATH to include DevKit...
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
D:\Anwendungen\ruby\ruby225-p319\lib\ruby\gems\2.2.0\gems\debase-0.2.1\ext>"..\..\..\..\..\..\..\..\devkit-2.0.0+\devkitvars.bat"
Adding the DevKit to PATH...

D:\Anwendungen\ruby\ruby225-p319\lib\ruby\gems\2.2.0\gems\debase-0.2.1\ext>make
linking shared-object debase_internals.so

Maybe there is an issue with the environment variables. It seems like there's a chained invocation of ruby and the second time devkit is not anymore added to the path.

I'm using uru to manage different ruby versions and ruby is not by default installed to my PATH. But on the other hand many other native gem extensions (like json, nokogiri, etc) install just fine with the same setup.

We can close this issue. After adding ruby and devkit to the path the gem install works fine. Going to open a ticket for uru to address the environment variable issue.

That's not true for me lumean, even doing what you said, debase can't get installed.

Yes, works fine here too with both msys2 and msvc++.