Install Ruby and Jekyll
I followed the instructions on the official Jekyll website to install Ruby on a macOS system using Brew.
First you need to install Ruby, the open-source programming language that Jekyll is written in. Ruby installation is pretty easy with Brew. Once you have Ruby installed, you install Jekyll as a “gem,” or a Ruby package.
- Open your terminal/command-line interface/shell, whatever you want to call it, I won’t judge you.
- Start by installing three packages:
chruby, a version-management tool for Ruby,ruby-install, a utility that handles Ruby installation, as well as XZ Utils, which is a data compression utility, and Git (assuming it is not already installed):brew install chruby ruby-install xz git - Now use Homebrew’s ruby-install package to install Ruby. I am installing Ruby 4.0.3, which was the stable version when I wrote this tutorial:
ruby-install ruby 4.0.3 - The installation may last about two minutes and the terminal will output a lot of text, but at the end you should see
>>> Successfully installed ruby 4.0.3 into ~/.rubies/ruby-4.0.3. (I am using~/as a shorthand to represent the home directory (or folder) of my user account on the MacBook Pro.) -
You want to configure your shell to use this installation of Ruby, and not another installation (such as the Ruby installation used by your macOS operating system). Since I am using Zsh, I use these three commands, which send the commands to
~/.zshrcwhich is like your Zsh instance’s preferences file:echo "source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh" >> ~/.zshrc echo "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrc echo "chruby ruby-4.0.3" >> ~/.zshrc # run 'chruby' to see actual version- You may want to confirm that those source commands were written to
.zshrc. You can do that withless ~/.zshrc, then looking at the end of the file to confirm you see the new lines appended to the file.
- You may want to confirm that those source commands were written to
- You now need to “source” Zsh with
source ~/.zshrc. This makes sure Zsh starts using those commands you just sent to the preferences. -
Confirm the version of Ruby you have with one or both of these commands:
- The command
which -a rubyshould output~/.rubies/ruby-4.0.3/bin/rubyand may also display/usr/bin/ruby. - The command
ruby -vshould returnruby 4.0.3 (2026-04-21 revision 85ddef263a) +PRISM [arm64-darwin25]but will vary based on what kind of computer you have.
- The command
- Now you can install Jekyll itself as a Ruby gem:
gem install jekyll. - That command will output many lines of text, one of which should be
Successfully installed jekyll-4.4.1. (Depending on when you do this, you may have a version later than 4.4.1.) - Check your installation with
which jekyll, which should return~/.gem/ruby/4.0.3/bin/jekyll. - You can also use
jekyll -v, which should returnjekyll 4.4.1.
Now you’re ready to Start Your First Jekyll Site.