<div dir="ltr">I know a lot of people on here use Macs (apologies to those that don't), so I thought I'd share something that caused me a lot of grief yesterday, in the hope that it saves other people some time.<div>
<br></div><div>The symptom was that "gem install mysql2" failed to build the code, but the error it gave was quite obscure;</div><div><br></div><div> checking for rb_thread_blocking_region()... *** extconf.rb failed ***<br>
</div><div><br></div><div>Digging a lot deeper, there's this compilation error, when it's trying to run the linker;</div><div><br></div><div> .rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/ruby.h:51:21: error: string.h: No such file or directory</div>
<div><br></div><div>It turns out that an update to Xcode helpfully deletes all the C header files needed to compile *anything*, and there's no obvious way to get it to put them back.</div><div><br></div><div>The comment at Oct 28, 2013 2:40 PM (currently the last comment on the page) at this URL explains what's going on and how to fix it;</div>
<div><br></div><div> <a href="https://discussions.apple.com/message/23497911#23497911">https://discussions.apple.com/message/23497911#23497911</a></div><div><br></div><div>The fix is to run "xcode-select --install" from the command line, which will put back the missing bits of the Xcode command-line tools.</div>
<div><br></div><div>Hope this helps someone.</div><div><br></div><div>David</div><div><br></div><div><br></div></div>