ruby-on-rails,rubygems,extconf.rb
Run this command: xcode-select --install ...
If you can rely on checking for a header file then have_header will define a HAVE_HEADER_H macro for you. For example: have_header('zlib.h') will define HAVE_ZLIB_H, which you can then refer to in your code. If this isn’t enough or you need to define a macro for some other reason you...
My research showed that MKMF is very limited in functionality. A better solution is to write a makefile and include the necessary ruby headers and libraries. So in the end I didn't use MKMF at all.