I decided to play with Jekyll today. It is an amazing static site generator. I ran local server by execute this command:
$> jekyll serve
I could browse my site locally then. When I had updated one of my files, Jekyll stated regenerating the output HTML file and I got this errors on the command line window.
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.
As I am not familiar with Ruby, it took me an hour to investigate and fix this problem. Actually, there are one warning and one error in the message above.
GitHub Metadata warning
GitHub Metadata is a gem required by Jekyll. We need a GitHub personal token to make it work. Follow the excellent guide on GitHub to create a token, copy it to a safe place.
Now, create new environment variable in your system named
JEKYLL_GITHUB_TOKEN with the value pasted from the created token. Open a new instance of command line and make sure this command displays correct information (I use Windows machine).
You can read more at the GitHub Metadata README file.
OpenSSL default certificate error
Please do not do these steps in a production server!
Now, down load the .pem file from https://curl.haxx.se/ca/cacert.pem. Then, create another environment variable called
SSL_CERT_FILE pointing to the location of downloaded .pem file.
Open new instance of command line window and run this command, be sure that there is no error now.
$> ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
With the steps above, I resolved my problems with Jekyll server command. If you try and find any trouble with them, please let me know by leaving comments at the bottom of the post.