Setting up Jekyll
In this post we are going to build a development environment to start building websites with Jekyll.
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:
If you see nothig then you have to install snap. Run:
After installing, we have to make sure that snap bin in included on the system Path. To do so, run:
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:
If everything installed correctly, you should now have Ruby and RubyGems installed properly:
Install GCC and Make
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
Install Bundler
And that is all! Now you can create a new Jekyll site:
Browse to http://localhost:4000