Skip to content

Local Enviromment

Dan Prince edited this page Nov 26, 2015 · 2 revisions

It can be very handy to get a local copy of Jekyll running so that you can preview posts in realtime. This is a guide to getting a Jekyll environment set up for editing.

Quick Start

If you know what you're doing, this should be enough to get you started. Otherwise, read about each of the steps.

sudo apt-get install -y ruby ruby-dev
sudo gem install jekyll
cd ~/AstralDynamics.github.io
jekyll serve

Dependencies

Install the following packages with your package manager.

  • ruby
  • ruby-dev
  • gem

On Ubuntu, you would run the following command.

sudo apt-get install -y ruby ruby-dev

The gem package is bundled with the ruby package.

Once you have the dependencies installed, verify that they are working by running the following commands and ensuring that none of them cause errors.

ruby -v
gem -v

Install

Now that you have rubygems installed, you can use it to install Jekyll.

sudo gem install jekyll

To check that it's working, run jekyll -v. You should see a version number.

Usage

To start the jekyll watcher, change into a Jekyll directory (it will have a _config.yml file). Then run:

jekyll serve

Jekyll will probably start on port 4000. Every time you make a change, it will rebuild the site and you can refresh the browser to see the difference.

Clone this wiki locally