Jekyll installation instruction on MacOS
MacOS is coming with a pre-installed Ruby - version 2.0.0p648 at time of writing. Jekyll requires a newer version of Ruby.
Assuming a Homebrew is installed on the MacOS.
-
Install a rbenv to manage the Ruby installation.
$ brew update $ brew install rbenv ruby-build # Add rbenv to bash so that it loads every time you open a terminal $ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile $ source ~/.bash_profile
-
Determine which stable versions are available.
$ rbenv install --list | grep '^\s*2.4' | grep -vE 'preview|dev|rc' 2.4.0 2.4.1
-
Install the new Ruby version.
$ rbenv install 2.4.1
-
Set the proper Ruby version to use.
$ rbenv global 2.4.1 $ ruby -v ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
-
Update RubyRails.
$ gem update --system
-
Install Jekyll. A specific version could be chosen. The latest didn't work for me.
$ gem install jekyll -v 3.4.3
-
Install or update a bundler.
$ gem install bundler
-
In the Jekyll local site root directory, create a Gemfile.
$ source 'https://rubygems.org' $ gem 'github-pages', group: :jekyll_plugins
-
Install a github-pages. The bundle way will probably fail, so use gem directly.
$ # bundle install $ gem install github-pages
-
Preview the Jekyll site - will be listening on http://localhost:4000/.
$ bundle exec jekyll serve