Jekyll: Failed to build gem native extension
26 Mar 2015 in TIL
When trying to install jekyll, I got the following error: mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
bash
$ sudo gem install jekyllFetching: liquid-2.6.2.gem (100%)Successfully installed liquid-2.6.2Fetching: kramdown-1.6.0.gem (100%)Successfully installed kramdown-1.6.0Fetching: mercenary-0.3.5.gem (100%)Successfully installed mercenary-0.3.5Fetching: safe_yaml-1.0.4.gem (100%)Successfully installed safe_yaml-1.0.4Fetching: colorator-0.1.gem (100%)Successfully installed colorator-0.1Fetching: posix-spawn-0.3.10.gem (100%)Building native extensions. This could take a while...ERROR: Error installing jekyll:ERROR: Failed to build gem native extension./usr/bin/ruby2.1 extconf.rbmkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
It turns out that I was missing the ruby development packages:
bash
$ sudo apt-get install ruby-dev
Once I'd installed this, Jekyll installed fine.