This is the only thing that worked for me!
I was trying to simply run bundle install for Ruby and the linking was off for some reason, I couldn't even build Ruby from source.
After 3 days trying everything this solved it and got rid of the error:
ruby/defines.h:16:10: fatal error: 'stdio.h' file not found
Many thanks!