Solving Jekyll issue with Mac OS X El Capitan 10.11
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
- Install XCode command line utilities (If not already installed).
- xcode-select –install
- Install homebrew (If not already installed)
- ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
- Update PATH to use homebrew before system default path (/usr/bin)
- Open (or create) ~/.bash_profile file and add following line
- export PATH=”/usr/local/bin:$PATH”
- Install ruby
- brew install ruby
- Install Jekyll
- gem install Jekyll
And we are done. Run your Jekyll site again. Happy blogging.
Leave a Reply