Link Search Menu Expand Document

Install

Table of contents
  1. Installing on MacOS
    1. Install Ruby
    2. Install Jekyll
    3. Create a new Jekyll site
  2. Install Jekyll on anything other than Mac OS

Installing on MacOS

Install Ruby

Ensure you install Ruby, not the ruby from the Apple default install. It will give you this error:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

Use Homebrew to install latest Ruby. If you haven’t had Homebrew installed:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then install Ruby

brew install ruby

Add Ruby path on your terminal:

# If you're using Zsh
echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/X.X.X/bin:$PATH"' >> ~/.zshrc
# If you're using Bash
echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/X.X.X/bin:$PATH"' >> ~/.bash_profile
# Unsure which shell you are using? Type
echo $SHELL

Refresh your shell

source ~/.zshrc
# or
source ~/.bash_profile

check the path and you shoud see anything other than: /usr/local/bin/ruby and check the version and it should be the latest:

which ruby

Mine would be:

/usr/local/opt/ruby/bin/ruby

Check ruby version

ruby -v

Install Jekyll

Install the Bundler:

gem install --user-install bundler jekyll

Create a new Jekyll site

Once the Jekyll is installed, you can start creating the site e.g in /blog folder:

jekyll new blog

In an indeal world you can just login to the new folder blog where the Jekyll install is and run bundle exec jekyll serve and will show you all details of configuration including the server you can go to in local. But since the following libraries are no longer bundled gems or standard libraries including webrick, this message will appear:

/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)

Then you need to run bundle add webrick providing you have bundle installed. This should let you run the bundle exec jekyll serve and the following message will appear:

Configuration file: /Users/irawan/dev/others/bloog/_config.yml
            Source: /Users/irawan/dev/others/bloog
       Destination: /Users/irawan/dev/others/bloog/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 0.465 seconds.
 Auto-regeneration: enabled for '/Users/irawan/dev/others/bloog'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

Where Server address: http://127.0.0.1:4000/ is your localhost address of your Jeckyll site. Once you

If you have an issue with missing gems, e.g:

Could not find commonmarker-0.17.13 in any of the sources

You will need to install the bundle and this will resolve the issue:

bundle install

Install Jekyll on anything other than Mac OS

Please rever to Jekyll installation on other OS


Table of contents