Jekyll installation error on Mac OS X El Capitan

If you’re running into the error below:

sudo gem install jekyll

Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
	ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ffi_call() in -lffi... no
checking for ffi_call() in -llibffi... no
checking for ffi_raw_call()... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile

make "DESTDIR="
mkdir -p "/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c"/libffi-i386; (if [ ! -f "/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c"/libffi-i386 && env CC=" xcrun clang" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 /Applications/Older Xcodes/Xcode.app/Contents/Developer/usr/bin/make -C "/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c"/libffi-i386
Configuring libffi for i386
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
env: /Applications/Older: No such file or directory
make: *** ["/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c"/libffi-i386/.libs/libffi_convenience.a] Error 127

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c/gem_make.out

Try this:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll

Also make sure Xcode and command line tools are installed:

sudo xcode-select --install

After the installation is finished, you need to accept the Xcode build license:

sudo xcodebuild -license

Gem Version 2.0.14

Ruby Version ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]