I recently updated my Mac OS X Yosemite (10.10) to El Capitan (10.11). Everything seems good for couple of days but as soon as I tried to run my Jekyll site, I’d a great surprise waiting for me.

 

jekyll serve –config=_config.yml,_config_dev.yml

-bash: jekyll: command not found

 

OOPs, where is my Jekyll? Expecting some of the installed programs are reverted after upgrade, I decided to install Jekyll again and found second surprise was waiting for me, instructions given on jekyllrb.com are not working any more. I followed same instructions on Yosemite in install Jekyll so I knew problem is with El Capitan, not jekyll.

 

After spending some time on google, visiting few sites, I finally find that Apple is now using System Integrity Protection (SIP) to restrict write access to some of system folders. This contains folder /Library/Ruby which is version of Ruby shipped with Mac. With SIP, ‘sudo gem install jekyll’ is no longer possible.

Solution

 

  1. Install XCode command line utilities (If not already installed).
    1. xcode-select –install
  2. Install homebrew (If not already installed)
    1. ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
  3. Update PATH to use homebrew before system default path (/usr/bin)
    1. Open (or create) ~/.bash_profile file and add following line
    2. export PATH=”/usr/local/bin:$PATH”
  4. Install ruby
    1. brew install ruby
  5. Install Jekyll
    1. gem install Jekyll

 

And we are done. Run your Jekyll site again. Happy blogging.