Não consigo descobrir porque wdm
não será instalado no meu computador. Eu tentei usar o bash Cygwin, Windows cmd e GIT bash.
Saída do console:
$ gem install wdm
Building native extensions. This could take a while...
ERROR: Error installing wdm:
ERROR: Failed to build gem native extension.
c:/Ruby22-x64/bin/ruby.exe -r ./siteconf20151202-6644-1ws9slg.rb extconf.rb
checking for main() in -lkernel32... *** 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:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
--with-kernel32lib
--without-kernel32lib
c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:456:in 'try_do': The compiler failed to gen
erate an executable file. (RuntimeError)
You have to install development tools first.
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:541:in 'try_link0'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:556:in 'try_link'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:735:in 'try_func'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:966:in 'block in have_library'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:911:in 'block in checking_for'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:351:in 'block (2 levels) in po
stpone'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:321:in 'open'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:351:in 'block in postpone'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:321:in 'open'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:347:in 'postpone'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:910:in 'checking_for'
from c:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:961:in 'have_library'
from extconf.rb:19:in '<main>'
extconf failed, exit code 1
Gem files will remain installed in c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/wdm-0.
1.1 for inspection.
Results logged to c:/Ruby22-x6
mkmf.log :
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby22-x64/include/ruby-2.2.0/x64-mingw32 -Ic:/Ruby22-x64/include/ruby-2.2.0/ruby/backward -Ic:/Ruby22-x64/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:/Ruby22-x64/lib -L. -lx64-msvcrt-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 */
Embora eu tenha um ambiente Cygwin com gcc em execução, a frase "Você precisa instalar primeiro as ferramentas de desenvolvimento" continha o pro dica para Segue.
Para ser mais preciso, faltava o compilador x86_64-w64-mingw32-gcc
. Eu baixei o instalador do SourceForge (o link para o download do instalador está acima da lista de arquivos) e consegui instalá-lo na segunda tentativa (a primeira tentativa falhou com uma mensagem download falhou ; parece ser aleatória).
No entanto, ainda não funciona.
Saída do console:
$ gem install wdm
Building native extensions. This could take a while...
ERROR: Error installing wdm:
ERROR: Failed to build gem native extension.
Também é a saída do console, mas esse também é o conteúdo do gem_make.out
:
c:/Ruby22-x64/bin/ruby.exe -r ./siteconf20151204-42084-zsi0td.rb extconf.rb
checking for main() in -lkernel32... yes
checking for windows.h... yes
checking for ruby.h... yes
checking for HAVE_RUBY_ENCODING_H... yes
checking for rb_thread_call_without_gvl()... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating wdm_ext-x64-mingw32.def
/bin/sh: /c/Ruby22-x64/bin/ruby: No such file or directory
Makefile:260: recipe for target 'wdm_ext-x64-mingw32.def' failed
make: *** [wdm_ext-x64-mingw32.def] Error 127
make failed, exit code 2
Mais saída do console:
Gem files will remain installed in c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/wdm-0.
1.1 for inspection.
Results logged to c:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
/wdm-0.1.1/gem_make.out
A linha /bin/sh: /c/Ruby22-x64/bin/ruby: No such file or directory
me confunde. Isso acontece em todos os três shells, Cygwin , GIT Bash , bem como CMD . No Bash do GIT , posso resolver o caminho /c/Ruby22-x64/bin/ruby
manualmente. Existe e funciona. Também which ruby
aponta para a direita ruby
também.