The answer was astoundingly simple.
I had a line in my extconf.rb
: $objs = %w{hypergeometric}
, which I copied from a different project. It turns out I missed the second half of the line:
$objs = %w{hypergeometric}.map { |i| i + ".o" }
I cannot for the life of me understand why this change would allow it to suddenly find ruby.h
.
In the end, the give-away was that weird error message:
ld: warning: ignoring file hypergeometric, file was built for unsupported file format ( 0x67 0x70 0x63 0x68 0x43 0x30 0x31 0x33 0x38 0x4b 0x73 0x92 0x3d 0xf1 0xa5 0x62 ) which is not the architecture being linked (x86_64): hypergeometric
but odd that it only happens the second time I run bundle exec rake compile
.