When I first typed bundle exec jekyll serve
on my Start Command Prompt With Ruby to run jekyll locally, I got this error:
jekyll 3.7.3 | Error: No source of timezone data could be found.
Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error.
So I couldn’t run jekyll locally and had to make a commit every time I wanted to see any change.
Later I found out it was because my project was created on Windows. The error indicated TZInfo was unable to find a source of time zone data from my system.
So I just simply added the following line
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
to Gemfile and now it runs successfully!
If you use a 64-bit version of Ruby on Windows, add :x64_mingw
to the list of platforms like this:
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
If you use are using JRuby, add :jruby
instead.
For more information, please refer to the official TZInfo document.