【问题标题】:How to configure Fedora 29 to use ruby 'number-theory' gem?如何配置 Fedora 29 以使用 ruby​​ 'number-theory' gem?
【发布时间】:2019-03-20 21:14:26
【问题描述】:

所以基本上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 没有找到。还有什么可以尝试的?

【问题讨论】:

    标签: ruby rubygems fedora stdint narray


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2019-06-12
      • 1970-01-01
      • 1970-01-01
      • 2019-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-20
      相关资源
      最近更新 更多