Setting Up Jekyll Development Environment on MacOS 10.14

dev edit

I’ve been using Jekyll for years to generate static site from my blogs. In many cases it’s enough to push the Markdown document but sometimes it does help to see it beforehand to notice broken links or as a general review. So I decided to set up dev environment for my blogs.

The Easy Way

In the past it used to be easy as running the commands below taken from Jekyll docs:

gem install jekyll bundler

Then navigate to blog folder in terminal and run:

bundle exec jekyll serve --drafts

The Hard Way

Turns out in MacOS Mojave (10.14) it doesn’t work anymore. You have run the command as root which is not advised. So I followed the commands listed here:

echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

After this I was able to run the command without root but I was still getting errors. Found the solution to that on this thread:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Ran the command and followed the wizard. After that I was able to install Jekyll and run it on my local machine.

Resources