在RedHat 7(AWS提供的ec2图片)上,我无法安装json gem:
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生扩展。
/usr/bin/ruby extconf.rb
mkmf.rb无法在/usr/share/include/ruby.h找到ruby的头文件
我已尝试过各种各样的软件包libyaml-devel等,但似乎没有任何工作。
我已经完成了: Error while installing json gem 'mkmf.rb can't find header files for ruby'
答案 0 :(得分:1)
sudo rpm -Uvh ftp://195.220.108.108/linux/centos/7.0.1406/os/x86_64/Packages/ruby-devel-2.0.0.353-20.el7.x86_64.rpm
这似乎解决了它,因为sudo yum ruby-devel不起作用。
答案 1 :(得分:1)
rhel在“可选”的回购中把这样的东西塞进去......你可以在aws / ec2提供的图片中启用这个:
/etc/yum.repos.d/redhat-rhui.repo
[rhui-REGION-rhel-server-optional]
name=Red Hat Enterprise Linux Server 7 Optional (RPMs)
mirrorlist=https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/7/$relea$
**enabled=1**
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify=1
sslclientkey=/etc/pki/rhui/content-rhel7.key
sslclientcert=/etc/pki/rhui/product/content-rhel7.crt
sslcacert=/etc/pki/rhui/cdn.redhat.com-chain.crt
或者只是进行一次性安装:
yum install ruby-devel --enablerepo = rhui-REGION-rhel-server-optional
答案 2 :(得分:0)
如果您使用订阅管理器:
subscription-manager repos --enable=rhel-7-server-optional-rpms
然后:sudo yum install -y ruby-devel