Jekyll Installation

“Pessimism is for suckers”

Hi Guys,

Welcome back in this aaaaaaamazing blog serie about Jekyll.
In the previous blog post (if you haven’t read it, do that guys! do that!) we talked about the decision about the technologies that were used to create this blog. Now we will go trough the installation/creation process.

Let’s Start (macOS installation)


In order to be able to work with Jekyll you need to have a properly configured Ruby dev environment.
Even if Ruby is already installed on macOS is better to have a “clean” installation. I can do a quick spoiler on the reason but if you want to have the full picture you can read the following: (Here the reason why).

SPOILER:

the version of Ruby installed on macOS is old (preinstalled version is 2.6.8) and for this reason you won’t receive further updates, security fixes and so on.
We will install Ruby using a version manager that will allow to install multiple version of Ruby and switch quite easily between them. As suggested on the Jekyll site we will install chruby.

Homebrew Installation

Homebrew installs the stuff you need that Apple (or your Linux system) didn’t.
Homebrew installs packages to their own directory and then symlinks their files into /usr/local (on macOS Intel).


If you do not have Homebrew installed on your system, open up a console and launch the following command:

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

Ruby Installation

At the end Homebrew will be installed and you can install chruby and ruby-install:

brew install chruby ruby-install xz

And then the latest version of Ruby:

ruby-install ruby

At the end you have to instruct your shell to use chruby:

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-3.1.2" >> ~/.zshrc # run 'chruby' to see actual version

You are quite set! just restart the terminal and launch this command to check that Ruby is correctly configured (you should see the version)

ruby -v

Jekyll Installation

If you are here means that you are in a good way and you didn’t mistakes. Now it’s the turn of Jekyll. Let’s launch the following:

gem install jekyll