Rails Errors :: can’t find header files for ruby at

By | 27/10/2015

Thanks to Apple’s annual OS X update I swiftly jumped on the El Capitan bandwagon, little did I know it would mess up a few things for my Rails Dev.

First off Bundler vanished and I was receiving a ‘-bash: bundle: command not found’ error.
I had to go back and install bundler again using the command:
$ sudo gem install bundler –no-user-install

Next up I was getting these two errors:

Ignoring psych-2.0.15 because its extensions are not built.  Try: gem pristine psych –version 2.0.15
Ignoring json-1.8.3 because its extensions are not built.  Try: gem pristine json –version 1.8.3

The first one I fixed with the $ gem pristine psych –version 2.0.15 command

However when I ran the second I got a mkmf.rb can’t find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h’ error.

Turns out I needed to re-install Command Line Developer Tools by running:

xcode-select –install 
(don’t forget to run Xcode and accept the licence by running
sudo xcodebuild -license and hitting space until you reach the bottom, then type ‘agree’ (no quotes) and hit enter.

Back to my rails project, hit bundle install and that seems to have fixed things!