cygwin에서 "컴파일러가 실행 파일을 생성하지 못했습니다"라는 메시지와 함께 Gem 설치가 실패합니다.

cygwin에서 "컴파일러가 실행 파일을 생성하지 못했습니다"라는 메시지와 함께 Gem 설치가 실패합니다.

에 여러 개의 gem을 설치하려고 하면 cygwin다음 오류가 계속 발생합니다./usr/share/ruby/2.2.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError)

이 오류는 아래 전체 오류 메시지의 일부입니다.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby.exe -r ./siteconf20150603-27012-w371hi.rb extconf.rb
*** 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
        [...truncated...]
        --without-pkg-config
/usr/share/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 /usr/share/ruby/2.2.0/mkmf.rb:541:in `try_link0'
        from /usr/share/ruby/2.2.0/mkmf.rb:556:in `try_link'
        from /usr/share/ruby/2.2.0/mkmf.rb:637:in `try_ldflags'
        from /usr/share/ruby/2.2.0/mkmf.rb:1780:in `pkg_config'
        from extconf.rb:15:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /cygdrive/d/d/.gem/ruby/gems/ffi-1.9.8 for inspection.
Results logged to /cygdrive/d/d/.gem/ruby/extensions/x86_64-cygwin/ffi-1.9.8/gem_make.out

Google에서 찾을 수 있는 모든 것을 시도했는데 그 중 일부는 실제로 작동했습니다.

  • Cygwin 설정을 통해 gem에 해당하는 cygwin 패키지 설치
  • 실패한 gem에 따라 더 많은 cygwin 패키지 설치

하지만 이 매우 구체적인 예에서는 무엇이 빠졌는지 찾을 수 없었습니다.

답변1

mkmf.log이 오류에 대한 해결책은 파일(나의 경우 ) 을 살펴보고 /cygdrive/d/d/Documents/.gem/ruby/extensions/x86_64-cygwin/ffi-1.9.8/mkmf.log어떤 라이브러리가 누락되었는지 확인하는 것이었습니다(그리고 그러한 모든 오류에 대한 것입니다).

내 경우에는 -lcrypt-lgmp가 실패했기 때문에 "cygwin-setup" libcrypt-devellibgmp-devel.

관련 정보