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.
Enjoyed reading this?
If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.
Related articles
- The HTTP Status Codes I Actually Check
A practical guide to common HTTP response codes, redirects, client and server errors, and the headers that explain them.
- What Makes a Website a Progressive Web App?
A practical look at service workers, web app manifests, installation, and the cases where a Progressive Web App is worth building.
- What a Static Site Generator Actually Does
A static site generator combines content and templates before deployment, producing HTML files that a web server can deliver directly.