【问题标题】:Errors installing ffi-1.9.10 gem安装 ffi-1.9.10 gem 时出错
【发布时间】:2017-07-31 13:07:27
【问题描述】:

我已经手动安装(在本地下载并安装): Selenium 独立服务器 3.40 IE 驱动服务器 3.4(32 位) 子进程 0.7.1

当我尝试手动安装 ffi 1.9.10 时,我收到以下 gem_make.out 错误。互联网安全非常严格,所以我无法 gem install filename.gem。我必须进行本地安装。谢谢

current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ffi-
1.9.10/ext/ffi_c
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20170731-1340-doe9ur.rb extconf.rb
checking for ffi.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:/Ruby24-x64/bin/$(RUBY_BASE_NAME)
    --with-ffi_c-dir
    --without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to 
generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:588:in `try_cpp'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1095:in `block in have_header'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in 
postpone'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1094:in `have_header'
from extconf.rb:16:in `<main>'

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

 C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/ffi-
1.9.10/mkmf.log

extconf failed, exit code 1

这是我的 mkmf.log 文件

package configuration for libffi is not found
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby24-x64/include/ruby-
2.4.0/x64-mingw32 -IC:/Ruby24-x64/include/ruby-2.4.0/ruby/backward -
IC:/Ruby24-x64/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -
D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-
3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -
D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -I 
C:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/Ruby24-
x64/lib -L. -pipe     -lx64-msvcrt-ruby240  -lgmp -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 */

谢谢, 斯科特

【问题讨论】:

标签: ruby rubygems ffi


【解决方案1】:

这无论如何都不是最简单的解决方案,但我向网络团队求助,我能够通过简单的方式“gem install selenium-webdriver”获得下载和安装 gems 的权限。

【讨论】:

    猜你喜欢
    • 2015-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-12
    相关资源
    最近更新 更多