Fedora gem can’t find header files

Software

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.

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!