Dev Notes

Various Cheat Sheets and Resources by David Egan/Carawebs.

Install Jekyll on Ubuntu


Jekyll, Linux, Sysadmin, Tools
David Egan

Jekyll is a static site generator that is “blog aware” - it looks like a dynamic website (and really it is) even though it is served up by static HTML and does not have a database. All the automatic connection and site building takes place locally, before the site is uploaded to production. With some Grunt configuration using rsync, Jekyll sites are easily deployed. Jekyll is not a CMS.

Jekyll requirements:

Useful article by Chris Oliver on setting up Ruby on Rails on Ubuntu 14.04 Trusty Tahr. This includes an interactive script generator that allows different versions of Ruby to be installed.

Set Up Ruby

Ruby dependencies:

sudo apt-get update

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties

Install Ruby using rbenv - will result in a more up to date version of Ruby compared with “sudo apt-get install ruby”.

First install rbenv. More info on rbenv here. This code based on the Chris Oliver article.

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

Install ruby-build:

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

rbenv install 2.1.2
rbenv global 2.1.2
ruby -v

Install Ruby gems: gem update --system # may need to be sudo

Tell Rubygems not to install local docs:

echo "gem: --no-ri --no-rdoc" > ~/.gemrc

NodeJS

Add this using a PPA repositiory.

sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update

sudo apt-get install nodejs

Install Jekyll

sudo gem install jekyll

Build a Jekyll site

gem install jekyll
jekyll new mysite
cd mysite
jekyll serve
# => Now browse to http://localhost:4000

comments powered by Disqus