Jekyll Local Installation

Prerequisites

Installing Ruby on Ubuntu

First of all, we need to install all the dependencies typing:

sudo apt-get install ruby-full build-essential zlib1g-dev

After that, we need to set up a gem installation directory for your user account. The following commands will add environment variables to your ~/.bashrc file to configure the gem installation path. Run them now:

echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Finally, we install Jekyll (Jekyll Site):

gem install jekyll bundler

Notice that we don't use the root user :-)

Installing Ruby and Jekyll on Mac OS X

Follow the Jekyll page installation guide.

Running Jekyll Serve

By default, the Jekyll server is launched with the following command (which is the one indicated on your website).

bundle exec jekyll serve

If in the process of building the server there is a dependency problem, for example, there is a missing library to install, it is necessary to delete the Gemfile.lock file so that it is rebuilt with the installed dependency. This list of dependencies is found in the Gemfile file (in Python it would be equivalent to the requirements.txt file) and the version of each of the installed gems (packages) is specified. Having a list of dependencies is important for future updates as well as knowing the libraries needed to run the server. Once the Gemfile.lock file is deleted, the command shown above is launched again and the dependency errors should end.

Add new pages to the site.

The pages are saved in the path /_pages/section/new_page.md. Special care must be taken in choosing the family to which the new page will belong so that it goes in the corresponding folder.

It is recommended to take as an example some .md file that is already done.

Notes for exercise cards.

  • Teaser Images size: multiple of 600x400px

FAQ

  • Error building Jekyll server:
jekyll build --incremental --verbose
  • Update Rubygems, bundler and Gemfile.lock:

    warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
    

    To use Bundler 2 in your .lockfile:

    Update Rubygems

    gem update --system
    

    Update bundler

    gem install bundler
    

    Update Gemfile.lock in your project

    bundler update --bundler
    
jekyll logo

Want a Jekyll website built?

Hire a Jekyll developer