2016-10-01 104 views
2

我跟着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 

回答

0

我找到了一個解決方案,以生成網站,而不會遇到錯誤:只需複製_includes_layouts_sass從主題C:\Ruby23\lib\ruby\gems\2.3.0\gems\minima-1.2.0的安裝目錄到項目目錄,即D:\www\my-awesome-site

Jekyll將首先檢查項目目錄中的主題文件。

當然這只是一個解決方法。