杰基尔 3.7.3 | 错误:找不到时区数据源

ast*_*boy 7 ruby-on-rails github jekyll

Configuration file: C:/Users/NiKhil GarakaPati/Documents/GitHub/Nikhil- 
Garakapati.github.io/_config.yml
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.
Run Code Online (Sandbox Code Playgroud)

将 Jekyll 模板安装到我的 Github 页面时遇到此错误。我尝试将这个时区:“America/Vancouver”添加到我的 _config.yml 文件中,但是没有用。然后我尝试在终端上运行gem install tzinfo-data,但无法清除错误。

有人能解决这个问题吗?

小智 6

从文件路径的结构来看,我猜测您使用的是 Windows 计算机。gemtzinfo-data对于在 Windows 上工作有点挑剔。这是有关如何解决它的文档。

如果您使用 Ruby on Rails 并且您的项目是在 Windows 上创建的,那么您可能会发现 Gemfile 中已经有一行,如下所示:

gem 'tzinfo-data', platforms: [:mingw, :mswin]

如果您在 Windows 上使用 64 位版本的 Ruby,请:x64_mingw按如下所示添加到平台列表中:

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

因此,如果您使用的是,gemfile请确保将该 gem 放入文件中。