Skip to content

Testing Locally

Torbjörn Klatt edited this page Feb 19, 2016 · 10 revisions

Disclaimer:

This has been tested on Unix and Macs. We don't think it's going to work on Windows.

Preparations

You will need Ruby. We recommend using RVM for setting up and managing the Ruby environment for this site.

  1. make sure to have ImageMagick's command line tool available on your machine

    The convert tool is used to process larger images such as with the lightbox_image Liquid tag.

  2. install RVM

  3. install Ruby 2.2.1:

     rvm install ruby-2.2.1
    

    Caveat: In case you have not the required access rights on your machine to install missing packages, please run rvm autolib fail before the above command. This will stop RVM trying to install missing packages (e.g. libyaml-dev) and just print the names of all missing packages. Your system's admin should then be able to install the missing dependencies.

  4. prepare an environment (called gemset):

     rvm use 2.2.1
     rvm gemset create jlescorg
     rvm use 2.2.1@jlescorg
     gem install bundler
    
  5. in the root of this repository on the source branch run:

     bundle install
    
  6. whenever your local Gemfile.lock differs from the one in the source branch, run:

     bundle install --clean
    

    to pick up updates of the installed and dependent gems and removed unused.

Testing Locally

First activate your local Ruby environment with rvm use 2.2.1@jlescorg unless its automatically activated when changing into the directory due to the .ruby-version and .ruby-gemset files.

Then you can simply run bundle exec jekyll serve --watch and it will build the site, serve it at localhost:4000 (or 127.0.0.1:4000) and update whenever you change some files for immediate inspection in your favourite browser.

In case you altered the configuration files (i.e. _config.yml) or one of the custom Jekyll plugins (in _plugins) you will have to stop and restart Jekyll.