Running Jekyll on Windows
ed on 22 Jul 2016Setting up Jekyll on Windows is not as easy as installing on Linux or macOS. Several errors may occur if you do not correctly setup dependencies for Jekyll on Windows.
Here are some common errors or warnings which may occur while setting up Jekyll on windows:
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
Error: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Error: Run jekyll build –trace for more information.
Fixing Jekyll OpenSSL default certificate error on Windows
Liquid Exception: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Do the following steps to fix this error on your local environment (please do not follow these steps in a production server!):
- Download the cacert.pem file and save this on your hard drive (recommended path
C:\RubyInstaller\cacert.pem
). - Now goto Control Panel > System > Advances system settings and click Environment Variables. Or simply type “environment variables” on Start menu search box.
- Then define new user variable with variable name
SSL_CERT_FILE
and variable valueC:\RubyInstaller\cacert.pem
. - Now click OK and Apply.
- System reboot may needed to work for first time.
Fixing Jekyll GitHub Metadata warning on Windows
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
If you have recently upgraded to Jekyll v3.x.x then you may face GitHub Metadata warning (in your local development environment) if you have have use any github-metadata, a.k.a. site.github
Liquid tag in your Jekyll site.
Here’s the solution to fix this warning and access GitHub Metadata on your Windows local development environment:
- Create an GitHub access token with
public_repo
scope. (Remember to keep your tokens secret; treat them just like passwords!) - Now similarly as previous goto Control Panel > System > Advances system settings and click Environment Variables. Or simply type “environment variables” on Start menu search box.
- Then define new user variable with variable name
JEKYLL_GITHUB_TOKEN
and GitHub access token as variable value (which is something likeabc123def456
). - Now click OK and Apply.
- System reboot may needed to work for first time.
For security reason you can also access GitHub token with the following command line while building or serving Jekyll site:
$ JEKYLL_GITHUB_TOKEN=abc123def456 bundle exec jekyll serve