How to install Jekyll on macOS
Jekyll turns Markdown and Liquid templates into a static website. On macOS, getting it running means installing Apple’s command-line tools, a current Ruby version, and the Jekyll gem.
Open Terminal and install the command-line tools:
xcode-select --install
If macOS asks you to accept the Xcode licence, run:
sudo xcodebuild -license
Install Ruby and Jekyll
Install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then use Homebrew to install Ruby:
brew install ruby
Install Jekyll:
sudo gem install jekyll
Check that the command is available:
jekyll -v
If that prints a Jekyll version, the installation worked.
Create a site and run it locally
Create a new site in a directory named site:
jekyll new site
Move into the new directory:
cd site
Jekyll themes may depend on additional Ruby gems listed in a Gemfile. Install Bundler if you do not already have it:
gem install bundler
Then build the site and start the local server:
bundle exec jekyll serve
Open http://localhost:4000 in your browser. Keep the Terminal window open while you work; Jekyll will rebuild the site when files change.
Ruby setup on macOS has changed over time, so commands from older tutorials may not match a current machine exactly. The useful check is still the same: jekyll -v should work, and bundle exec jekyll serve should start the site.