How to install Jekyll 4.0 on macOS
Published: 15 September 2019
Filed Under: macOS
Whether you're using Jekyll to build your own blog, static site, or using it as part of a development environment, you can get it up and running on your macOS system in a few simple steps. You'll be running all of these commands from the terminal. Be sure to check out the documentation and review the additional commands below after installation.
Install the Xcode Command Line Tools
You'll need to install the Xcode Command Line Tools so that you can run development tools from the terminal. During the setup a software update box may popup. You don't need to get the full Xcode application, you just need to install the tools.
Installing Homebrew will allow you to easily install other packages, including a newer version of Ruby and Jekyll.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
macOS already comes preloaded with an old version of Ruby, but this will install the latest release, add the location to your path, and then you must manually quit and relaunch the bash terminal.
brew install ruby echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Install Jekyll and Bundler
gem install --user-install bundler jekyll echo 'export PATH=$HOME/.gem/ruby/2.6.0/bin:$PATH' >> ~/.bash_profile
The first step is to create a new Jekyll site.
jekyll new sitename cd sitename bundle update --bundler
Test the site using the built-in development server, then point your browser to http://localhost:4000.
bundle exec jekyll serve
Build your static site into the _site subdirectory.
bundle exec jekyll build
Remember to update installed packages from time to time.
brew update gem update