I’ve been narrowing it down, it doesn’t seem related to the gems, it seems to be related to extconf.rb. I tried with other few gems with a more complex setup (ruby-magic and libusb), both doesn’t work (for different reason) all they have in common are dependencies at extconf.rb.