How to successfully run Jekyll on Mac OS Catalina

Ajeet Singh Raina - Mar 22 '21 - - Dev Community

Alt Text

Follow the below steps to get Jekyll up and running on MacOS Catalina

Install Ruby

brew install ruby
Enter fullscreen mode Exit fullscreen mode

Setup environmental variable

export PATH="/usr/local/opt/ruby/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

Checking the Ruby paths

which ruby
/usr/local/opt/ruby/bin/ruby
Enter fullscreen mode Exit fullscreen mode

Fixing the path

PATH="`ruby -e 'puts Gem.user_dir'`/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

Fixing the “ffi” gem error

brew install libffi
Enter fullscreen mode Exit fullscreen mode
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
Enter fullscreen mode Exit fullscreen mode

Installing Jekyll

gem install --user-install bundler jekyll     
Successfully installed bundler-2.2.15
Successfully installed jekyll-4.2.0
2 gems installed
Enter fullscreen mode Exit fullscreen mode

Verifying if Jekyll is installed

jekyll
A subcommand is required. 
jekyll 4.2.0 -- Jekyll is a blog-aware, static site generator in Ruby

Usage:

  jekyll <subcommand> [options]

Options:
        -s, --source [DIR]  Source directory (defaults to ./)
        -d, --destination [DIR]  Destination directory (defaults to ./_site)
            --safe         Safe mode (defaults to false)
        -p, --plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]  Plugins directory (defaults to ./_plugins)
            --layouts DIR  Layouts directory (defaults to ./_layouts)
            --profile      Generate a Liquid rendering profile
        -h, --help         Show this message
        -v, --version      Print the name and version
        -t, --trace        Show the full backtrace when an error occurs

Subcommands:
  compose               
  docs                  
  import                
  build, b              Build your site
  clean                 Clean the site (removes site output and metadata file) without building.
  doctor, hyde          Search site and print specific deprecation warnings
  help                  Show the help message, optionally for a given subcommand.
  new                   Creates a new Jekyll site scaffold in PATH
  new-theme             Creates a new Jekyll theme scaffold
  serve, server, s      Serve your site locally
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .