OS X fsevent fatal error 'stdio.h' file not found

Getting the following error on Mac OS X? Read on.

fsevent/fsevent_watch.c:1:10: fatal error: 'stdio.h' file not found

XCode 4.3 and later does not install unix tools, so the usual header files are missing.

The following bit of magic is needed:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/

Re-run your gem install / bundle and it should work now.

I know this site is a bit of a disaster zone, but if you like my writing or think you could learn something useful from me, please take a look at the Haskell book I've been writing. There's a free sample available too!