I have a recently installed RHEL7 system, and need to do gem install jekyll, however this fails as:
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 be such 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?
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.
So by default as mentioned above the optional
repository is not enabled. Don't add another repo.d file as it already exists just that it is disabled.
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 not optional-source
Enable 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 makecache
Finally, you can install ruby-devel
:
yum install ruby-devel
Depending on your user's permissions you may need to use sudo
.