Ruby版本2.2.4p230
RubyGem版本2.7.2
安装了Ruby-devel和lib64ffi-devel。
使用64位OpenMandriva 3.0,urpmi和rpmdrake。
目标:安装罗盘,但首先需要宝石ffi。
我在过去的两天里一直在努力搜索互联网而且我很难过......我不可能安装早期版本的ruby,因为它依赖于较老的ncurses。我觉得替换ncurses会打开一堆令人讨厌的蠕虫。
然而......我也对罗盘替代方案完全开放,其中config.rb项目文件可以以某种方式移植/复制,因此罗盘和其他sass编译器都可以运行。 (这是为了工作,我们不会很快改变sass建设者。)
/usr/share/gems/gems/ffi-1.9.18/ext/ffi_c完全存在,该目录中有一个ffi.c文件,但在附近找不到任何ffi.h文件。在绝望的时刻,我触摸了该目录中的ffi.h,当我运行gem install时,它将其移除。 ;)我会尝试复制别人的libs,看看是否有效。
基本上任何方法都可以在不破坏其他软件包的情况下实现此功能。我不会将红宝石用于其他任何事情,只需指南针。
这是输出:
# 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
任何帮助表示赞赏!
答案 0 :(得分:0)
您的错误消息显示:
/usr/share/ruby/mkmf.rb:456:在“ try_do”中:编译器无法生成可执行文件。 (RuntimeError) 您必须先安装开发工具。
这就是解决问题的方法:
xcode-select --install
(但请事先确保xcode-select -p
将路径返回到稳定的Xcode版本,例如Xcode 10)