2015-04-30 34 views
0

謝謝!我在windows9上安裝了jekyll,但當我在中文博客上使用jekyll時,它顯示utf8錯誤,但是當我在僅限英文的博客上使用jekyll時,它工作正常! 這裏是我的截圖windows8上的Jekyll有UTF8錯誤

澤普@ ZEPUXI/E/Github上/ UTF8

$ jekyll serve 

Configuration file: e:/Github/utf8/_config.yml 

     Source: e:/Github/utf8 
    Destination: e:/Github/utf8/_site 
    Generating... 
    Error reading file e:/Github/utf8/_posts/2015-04-11-jekyll_on_windows.md: invalid 
    byte sequence in UTF-8 
    jekyll 2.4.0 | Error: invalid byte sequence in UTF-8 

這是擔任一個英文博客截圖

$ jekyll serve 
Configuration file: e:/Github/rifyll-master/rifyll-master/_config.yml 
     Source: e:/Github/rifyll-master/rifyll-master 
    Destination: e:/Github/rifyll-master/rifyll-master/_site 
    Generating... 
       done. 
Please add the following to your Gemfile to avoid polling for changes: 
gem 'wdm', '>= 0.1.0' if Gem.win_platform? 
Auto-regeneration: enabled for 'e:/Github/rifyll-master/rifyll-master' 
Configuration file: e:/Github/rifyll-master/rifyll-master/_config.yml 
Server address: http://0.0.0.0:4000/ 
Server running... press ctrl-c to stop. 

(主),所以我的中國博客_config.yml是這裏:

encoding: UTF-8 

# Dependencies 
markdown:   rdiscount 
highlighter:   pygments 


# Permalinks 
# 
# Use of `relative_permalinks` ensures post links from the index work 
permalink:   pretty 
relative_permalinks: true 

我如何解決這個問題?謝謝!

+0

我使用Ruby版本是2.0.0 – Zepu

回答

0

您能查看你的文件e:/Github/utf8/_posts/2015-04-11-jekyll_on_windows.md沒有BOM

  1. 圍棋在文本編輯器我們的IDE設置文件編碼的loock。是 一定要選擇utf-8no BOM(記事本++做得很好)。
  2. 保存文檔
  3. Jekyll serve --trace