Gagal menginstal Ruby Gem asli wdm 0.1.1 pada Windows 7 x64 (Ruby 2.2.0)


2

Cerita yang sudah ketinggalan zaman (temukan pembaruan di bawah tajuk berikutnya)

Saya tidak tahu mengapa wdm tidak mau dipasang di komputer saya. Saya telah mencoba menggunakan bash Cygwin, Windows cmd dan GIT bash.

Output konsol:

$ 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 */

Perbarui 1

Meskipun saya punya Cygwin lingkungan dengan gcc berjalan, kalimat "Anda harus menginstal alat pengembangan dulu" berisi itu tip pro untuk mengikuti. Untuk lebih tepatnya saya tidak punya x86_64-w64-mingw32-gcc penyusun. Saya mengunduh installer dari SourceForge (Link ke installer download di atas daftar file) dan berhasil menginstalnya pada percobaan kedua (percobaan pertama gagal dengan pengunduhan gagal pesan; tampaknya acak).

Namun, itu masih tidak berhasil.

Output konsol:

$ gem install wdm
Building native extensions.  This could take a while...
ERROR:  Error installing wdm:
        ERROR: Failed to build gem native extension.

Juga keluaran konsol, tetapi ini adalah konten dari gem_make.out demikian juga:

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

Output konsol lebih lanjut:

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

Garis /bin/sh: /c/Ruby22-x64/bin/ruby: No such file or directory membingungkan saya. Ini terjadi pada ketiga cangkang, Cygwin , GIT Bash sebaik CMD . Dalam GIT Bash Saya bisa menyelesaikan jalan /c/Ruby22-x64/bin/ruby secara manual. Itu ada dan berfungsi. Juga which ruby menunjuk ke kanan ruby demikian juga.

Dengan menggunakan situs kami, Anda mengakui telah membaca dan memahami Kebijakan Cookie dan Kebijakan Privasi kami.
Licensed under cc by-sa 3.0 with attribution required.