How to setup Jekyll on Ubuntu/Raspberry Pi

March 13, 2017

This is the installation guide for Jekyll on Ubuntu/Raspberry Pi. Normally there won’t be any problem to install on Ubuntu but installation for Raspberry Pi is a little tricky due to SSL certificate issue.

1. Install Ruby and gems

First we will install Ruby.

$ sudo apt-get install ruby-full

2. Update Rubygems

Ruby uses gem as package manager. We should get the lastest version of it.

$ sudo gem update --system

:memo: You can check your Rubygems version by gem --version

2.1 Update Rubygems manually (If you have SSL certificate problem)

Download the Rubygems. You can get the latest version from here and more info about SSL issue here.

$ wget https://rubygems.org/gems/rubygems-update-2.6.10.gem --no-check-certificate
$ sudo gem install rubygems-update-2.6.10.gem
$ sudo gem sources --remove https://rubygems.org/
$ sudo gem sources -a http://rubygems.org/
$ sudo update_rubygems
$ sudo gem update --system

3. Install Dependency Packages

$ sudo apt-get install build-essential
$ sudo apt-get install zlib1g-dev

4. Install Jekyll

Now we start installing as Jekyll gem. More info from here.

$ sudo gem install jekyll

5. Install bundler gem

This is also a gem but it manages others gems. More info from here.

$ sudo gem install bundler

6. Setup Jekyll

$ cd ~
$ mkdir JekyllWorkSpace
$ cd JekyllWorkSpace
$ jekyll new myblog
$ cd myblog
$ bundle install

:exclamation: If you have again SSL certificate problem while you type in sudo bundle install, change source "https://rubygems.org" to source "http://rubygems.org" in Gemfile which is located in newly crated myblog folder.

7. Run server

Now it’s time to see the real action.

$ bundle exec jekyll serve

Now type this http://localhost:4000 into any browser address. You should see a home page.

:memo: You can run with the specific port (eg. port 4010) by running this bundle exec jekyll serve --port 4010 if port 4000 is in use.