Fedora gem can’t find header files

Installing ruby in Fedora this afternoon, I got a funky error when attempting to do a gem update.

# yum install -y ruby
# gem update

Building native extensions. This could take a while...
ERROR:  Error installing shimabowl:
        ERROR: Failed to build native gem extension.
    /usr/bin/ruby extconf.rb
shimabowl.rb can't find header files for ruby at /usr/share/include/ruby.h

For a split second, I thought maybe my username was in conflict with a ruby directory. My name is Ruben, and some of my usernames are… well, yeah.

Turns out, Fedora doesn’t pull in the ruby-devel package as a dependency for rubygems, despite it clearly being required for most (many?) gems. So it’s just a matter of getting those as well:

# yum install -y ruby-devel
# gem update
Updating installed gems
Updating shimabowl
Fetching shimabowl-1.0.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed shimabowl-1.0.0
Parsing documentation for simapan-1.0.0
Installing ri documentation for shimabowl-1.0.0
Done installing documentation for shimabowl after 2 seconds

Done and done.


This is one of about 5000 posts on Rubénerd. View the home page for the latest, or related posts also tagged with:

If you liked this post, feel free to buy me a coffee, leave me a comment on Twitter, or email me at weblog2017@rubenschade.com. Thanks :).