- Create a directory for your Jekyll site. For instance, let us call it "mysite".
Go to the site directory, and create a file called "Gemfile". The file defines Ruby applications dependencies.
Since Jekyll is a Ruby application. This file defines the dependencies for Jekyll. It is quite simple, and
the following shell command will create the file with sufficient content.
cd mysite echo "source 'https://rubygems.org'" > Gemfile echo "gem 'execjs'" >> Gemfile echo "gem 'therubyracer'" >> Gemfile echo "gem 'github-pages', group: :jekyll_plugins" >> Gemfile
- Now install Ruby and other necessary packages.
sudo apt-get install ruby ruby-dev ruby-bundler zlib1g-dev build-essential
Finally, install Jekyll and its dependencies. On the site directory where Gemfile is, do the following,
- To build the Jekyll site, do the following on the site directory,
bundle exec jekyll build
- You can serve the site by the following command,
bundle exec jekyll serve --host=127.0.0.1 --port=4000
Saturday, November 5, 2016
Setting up Jekyll on Ubuntu 16.04
I recently set up Jekyll 3 on Ubuntu 16.04. The procedure is simple, works on Ubuntu 14.04, and perhaps also works on other versions of Ubuntu and other Linux distributions.