【问题标题】:Error reading file in Jekyll在 Jekyll 中读取文件时出错
【发布时间】:2016-10-01 16:36:27
【问题描述】:

我按照Jekyll中的所有说明进行操作:

gem install jekyll bundler
jekyll new my-awesome-site
cd my-awesome-site
bundle install
bundle exec jekyll serve

然后,当我浏览到http://localhost:4000 时,会出现一个空白页面,并且命令提示符中出现以下错误:

Error reading file C:/Ruby23/lib/ruby/gems/2.3.0/gems/minima-1.2.0/_layouts/default.html: No such file or directory @ rb_sysopen - /Ruby23/lib/ruby/gems/2.3.0/gems/minima-1.2.0/_layouts/default.html
Error reading file C:/Ruby23/lib/ruby/gems/2.3.0/gems/minima-1.2.0/_layouts/page.html: No such file or directory @ rb_sysopen - /Ruby23/lib/ruby/gems/2.3.0/gems/minima-1.2.0/_layouts/page.html
Error reading file C:/Ruby23/lib/ruby/gems/2.3.0/gems/minima-1.2.0/_layouts/post.html: No such file or directory @ rb_sysopen - /Ruby23/lib/ruby/gems/2.3.0/gems/minima-1.2.0/_layouts/post.html

发生这种情况是因为我在分区 D: 中使用 Jekyll,而 Ruby 安装在分区 C: 中。事实上,如果我将所有项目安装在一个分区中,则不会出现错误,但我更喜欢将所有项目保留在分区 D: 中。我相信问题出在rb_sysopen

有什么解决办法吗?谢谢。

这是我Gemfile.lock的一部分:

PLATFORMS

- x86-mingw32

DEPENDENCIES

- jekyll (= 3.2.1)
- minima

RUBY VERSION

- ruby 2.3.1p112

BUNDLED WITH

- 1.13.2

【问题讨论】:

    标签: ruby jekyll


    【解决方案1】:

    我找到了生成网站不报错的解决方案:只需将主题C:\Ruby23\lib\ruby\gems\2.3.0\gems\minima-1.2.0的安装目录下的_includes_layouts_sass复制到项目目录下,即D:\www\my-awesome-site即可。

    Jekyll 会先检查项目目录下的主题文件。

    当然,这只是一种解决方法。

    【讨论】:

      猜你喜欢
      • 2013-09-26
      • 2015-08-11
      • 1970-01-01
      • 2013-08-28
      • 2011-09-28
      • 2017-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多