如何配置Fedora 29以使用ruby'number-theory'gem?

时间:2019-03-20 21:14:27

标签: ruby rubygems fedora stdint narray

因此,RubyNumberTheory基本上需要NArray gem,并且似乎需要一些本机编译工具和可能的一些其他配置。所以在Fedora 29上,这是尝试过的

$ gem install narray 
Building native extensions. This could take a while...
ERROR:  Error installing narray:
    ERROR: Failed to build gem native extension.
[…]
checking for stdint.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.

我确实通过dnf安装了一些软件包,例如gcc ruby-devel rubygemsgroup install "C Development Tools and Libraries",甚至还有一些意想不到的arm-none-eabi-newlib。实际上,该标头似乎已正确安装在系统上

$ whereis stdint.h
stdint: /usr/include/stdint.h

即使环境变量设置如下:

export LIBRARY_PATH=/usr/include
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/include

该gem仍然无法安装,提示未找到stdint.h。还有什么可以尝试的?

1 个答案:

答案 0 :(得分:0)

查看mkmf.log文件,似乎系统缺少redhat-hardened-cc1,因此,一个简单的sudo dnf install redhat-rpm-config就解决了这个问题。