首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装ffi红宝石时找不到ffi.h

安装ffi红宝石时找不到ffi.h
EN

Stack Overflow用户
提问于 2017-11-10 20:36:24
回答 1查看 1.5K关注 0票数 2

Ruby版本2.2.4p230

RubyGem版本2.7.2

红宝石开发和lib64ffidevel安装。

64位OpenMandriva 3.0,使用urpmi和rpmdrake .

目标:安装指南针,但创业板是首先需要的。

在过去的两天里,我一直在网络上搜索,我很困惑.对于我来说,安装早期版本的ruby是不可能的,因为它依赖于旧的ncurses。我觉得取代诅咒会打开一罐讨厌的虫子。

然而..。我也完全开放给指南针选择,在那里config.rb项目文件可以以某种方式被移植/复制,这样罗盘和其他sass编译器都可以操作。(这是为了工作,我们不会很快更换sass的建设者)。

/usr/share/gems/gems/ffi-1.9.18/ext/ffi_c完全存在,该目录中有一个ffi.c文件,但在附近找不到任何ffi.h文件。在绝望的时刻,我触碰了dir中的ffi.h,当我运行宝石时,安装它,将它移除。我会试着抄一份别人的唇语,看看它是否有效。

基本上,任何不破坏我的包的方法都可以让它正常工作。我不用红宝石做其他的事,只是指南针。

这是输出:

代码语言:javascript
复制
# sudo gem install ffi
Building native extensions. This could take a while...
ERROR:  Error installing ffi:
    ERROR: Failed to build gem native extension.

current directory: /usr/share/gems/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby -r ./siteconf20171110-17988-1lodsok.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}/lib64
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/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}/lib64
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/usr/share/ruby/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/mkmf.rb:587:in `try_cpp'
    from /usr/share/ruby/mkmf.rb:1060:in `block in have_header'
    from /usr/share/ruby/mkmf.rb:911:in `block in checking_for'
    from /usr/share/ruby/mkmf.rb:351:in `block (2 levels) in postpone'
    from /usr/share/ruby/mkmf.rb:321:in `open'
    from /usr/share/ruby/mkmf.rb:351:in `block in postpone'
    from /usr/share/ruby/mkmf.rb:321:in `open'
    from /usr/share/ruby/mkmf.rb:347:in `postpone'
    from /usr/share/ruby/mkmf.rb:910:in `checking_for'
    from /usr/share/ruby/mkmf.rb:1059: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:

  /usr/lib64/gems/ruby/ffi-1.9.18/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/share/gems/gems/ffi-1.9.18 for inspection.
Results logged to /usr/lib64/gems/ruby/ffi-1.9.18/gem_make.out

任何帮助都很感激!

EN

回答 1

Stack Overflow用户

发布于 2018-10-20 20:28:39

您的错误消息显示:

/usr/share/ruby/mkmf.rb:456:in‘`try_do':编译器无法生成可执行文件。(RuntimeError)您必须首先安装开发工具。

所以你才能解决这个问题:

代码语言:javascript
复制
xcode-select --install

(但要事先确保xcode-select -p将路径返回到稳定的Xcode版本,如Xcode 10)

另见https://github.com/ffi/ffi/issues/647

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47230735

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档