In this post we are going to build a development environment to start building websites with Jekyll.

alt text

Jekyll is a blog-aware, static site generator writen in Ruby perfect for personal, project, or organization sites.

Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind GitHub Pages, which you can use to host sites right from your GitHub repositories.

Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo.

Requirements

As it was mentioned before, Jekyll runs in Ruby, therefore we need to install Ruby version 2.4.0 or above, including all development headers.

You chan check if you already have ruby installed by running ruby -v

Installing Ruby in Ubuntu 18.04 using snapd

Snappy is a software deployment and package management system developed by Canonical for the Linux operating system.

If you are not sure if you already have snap, check it running snap --version. If you see something like this:

$ snap --version

snap    2.43.3
snapd   2.43.3
series  16
kernel  4.15.0-66-generic

If you see nothig then you have to install snap. Run:

$ sudo apt update
$ sudo apt install snapd

After installing, we have to make sure that snap bin in included on the system Path. To do so, run:

$ which snap

/usr/bin/snap

If you dont see the /usr/bin/snap outcome, then you have to manually include snap on the PATH environmental variable. To do so, you have to edit /etc/environment and add :/snap/bin to the end of the PATH string.

Great! Now you can proceed to install Ruby:

$ sudo snap install ruby --classic

If everything installed correctly, you should now have Ruby and RubyGems installed properly:

$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]

$ which ruby
/snap/bin/ruby
$ gem -v
3.1.2

Install GCC and Make

$ sudo apt install gcc, g++, build-essential

So far, we have installed Ruby and and it’s package manager (or ‘gem’ manager), RubyGems. The next step would be install Jekyll and Bundler.

Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.

Install Jekyll

$ gem install jekyll

Install Bundler

$ gem install bundler

And that is all! Now you can create a new Jekyll site:

$ jekyll new my_site
$ cd my_site
$ bundle exec jekyll serve

Browse to http://localhost:4000