install this: https://github.com/parkr/ruby-build-github
And then install the ruby version 2.1.7 rbenv install 2.1.7-github
go in the folder of your website. Run:
rbenv local 2.1.7-github
This will set the ruby version of your project to 2.1.7.
then:
gem install bundle
After this, make a Gemfile like this
source 'https://rubygems.org'
require 'json'
require 'open-uri'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'activesupport', '4.2.7'
gem 'github-pages', versions['github-pages'], group: :jekyll_plugins
Note, 'activesupport' has to be declared before 'github-pages'
run bundle install
.
You should now be able to build your website using bundle exec jekyll build
and to run it locally with jekyll serve
If, when pushing to github the build fails, test it locally first:
bundle exec jekyll build --verbose