[LRUG] Building gems on OSX 10.9 Mavericks

David Salgado david at digitalronin.com
Thu Nov 7 04:20:11 PST 2013


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.

The symptom was that "gem install mysql2" failed to build the code, but the
error it gave was quite obscure;

    checking for rb_thread_blocking_region()... *** extconf.rb failed ***

Digging a lot deeper, there's this compilation error, when it's trying to
run the linker;

    .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

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.

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;

    https://discussions.apple.com/message/23497911#23497911

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.

Hope this helps someone.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20131107/88970499/attachment.html>


More information about the Chat mailing list