RHEL7 中没有 ruby-devel 吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30665912/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No ruby-devel in RHEL7?
提问by user3852791
I have a recently installed RHEL7 system, and need to do gem install jekyll, however this fails as:
我最近安装了一个 RHEL7 系统,需要执行 gem install jekyll,但是这失败了:
Fetching: yajl-ruby-1.2.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
Google suggest this is due to the lack of a ruby-devel package being installed. However there doesn't seem to besuch a package in RHEL7. Do I need to move to a software collection (don't really want to do this as this will be for a production machine, not development) or can I get it some other way?
谷歌建议这是由于缺少安装的 ruby-devel 包。但是似乎没有到可以在RHEL7这样的包。我是否需要转移到软件集合(真的不想这样做,因为这将用于生产机器,而不是开发)还是我可以通过其他方式获得它?
回答by juice
This answer comes by way of piecing together bits from other answers - so to the previous contributors...thank you because I would not have figured this out.
这个答案是从其他答案中拼凑出来的 - 所以对于以前的贡献者......谢谢你,因为我不会想到这一点。
This example is based on the RHEL 7 AMI (Amazon Managed Image) 3.10.0-229.el7.x86_64.
此示例基于 RHEL 7 AMI(Amazon Managed Image)3.10.0-229.el7.x86_64。
So by default as mentioned above the optionalrepository is not enabled. Don't add another repo.d file as it already exists just that it is disabled.
因此,如上所述,默认情况下optional未启用存储库。不要添加另一个 repo.d 文件,因为它已经存在,只是它被禁用了。
To enable first you need the name. I used grep to do this:
grep -B1 -i optional /etc/yum.repos.d/*above each name will be the repo id enclosed in
[ ]look for the optional notoptional-sourceEnable the optional repo:
yum-config-manager --enable <repo-id>Refresh the yum cache (not sure if this is necessary but it doesn't hurt):
sudo yum makecacheFinally, you can install
ruby-devel:yum install ruby-devel
要首先启用,您需要名称。我用 grep 来做到这一点:
grep -B1 -i optional /etc/yum.repos.d/*每个名称上方将是包含在
[ ]查找可选not 中的 repo idoptional-source启用可选的回购:
yum-config-manager --enable <repo-id>刷新 yum 缓存(不确定是否有必要,但不会有什么坏处):
sudo yum makecache最后,您可以安装
ruby-devel:yum install ruby-devel
Depending on your user's permissions you may need to use sudo.
根据您用户的权限,您可能需要使用sudo.
回答by slk
You need to subscribe to the optionalrepo to get all the devel packages.
您需要订阅可选的repo 以获取所有开发包。
subscription-manager repos --enable rhel-7-server-optional-rpms
This is because the ruby-develpackage is contained in the rhel-7-server-optional-rpmsrepository.
这是因为该ruby-devel包包含在rhel-7-server-optional-rpms存储库中。
回答by far4d
At least on Oracle Linux 7 you have to enable an additional repo.
至少在 Oracle Linux 7 上,您必须启用额外的存储库。
[root@foo ~]# yum repolist
repo id repo name
[...]
ol7_optional_latest/x86_64 Oracle Linux 7Server Optional Latest (x86_64)
After enabling the repo ruby-develsits there, awaiting your installation.
启用 repo 后,它就ruby-devel在那里,等待您的安装。
[root@foo ~]# yum info ruby-devel | egrep 'Name|Version|From'
Name : ruby-devel
Version : 2.0.0.598
From repo : ol7_optional_latest
That's all.
就这样。
回答by BOH
ruby-devel RPM is available in the following repo on RHEL 7
ruby-devel RPM 在 RHEL 7 上的以下存储库中可用
rhel-7-server-optional-beta-rpms
rhel-7-server-optional-beta-rpms
Set "enabled = 1" for this repo in your .repo file and then run
在 .repo 文件中为此 repo 设置“enabled = 1”,然后运行
yum install ruby-devel
yum install ruby-devel
回答by Neil Millard
additional repos are available to your RHEL 7
额外的存储库可用于您的 RHEL 7
# yum -y install yum-utils
# yum repolist all
This will list all available repos. Enable the repo you need. The devel packages are in extras for instance:
这将列出所有可用的存储库。启用您需要的回购。开发包是额外的,例如:
# yum-config-manager --enable rhui-REGION-rhel-server-extras
After performing these steps, I could then install ruby-devel, augeas-devel and install/compile
执行完这些步骤后,我可以安装 ruby-devel、augeas-devel 并安装/编译
# gem install ruby-augeas
回答by 0xack13
I had the same issue and ended up downloading the package from:
我遇到了同样的问题,最终从以下位置下载了软件包:
https://www.rpmfind.net/linux/rpm2html/search.php?query=ruby-devel
https://www.rpmfind.net/linux/rpm2html/search.php?query=ruby-devel
In RHEL7.5, this package can be installed with:
在 RHEL7.5 中,这个包可以安装:
rpm -ivh ruby-devel-2.0.0.648-33.el7_4.x86_64.rpm
Also, the development tools can be installed before that using:
此外,开发工具可以在使用之前安装:
yum groupinstall "Development Tools"
回答by rick
Install ruby package on your system and try again.
在您的系统上安装 ruby 包并重试。
sudo yum install ruby193-ruby-devel.x86_64
回答by x86 nick
You can download from:
您可以从以下网址下载:
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/ruby-devel(x86-64)
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/ruby-devel(x86-64)
Something like this would work:
像这样的事情会起作用:
wget ftp://bo.mirror.garr.it/1/centos/7.2.1511/os/x86_64/Packages/ruby-devel-2.0.0.598-25.el7_1.x86_64.rpm
rpm -ivh ruby-devel-2.0.0.598-25.el7_1.x86_64.rpm

