While setting up my blog using Jekyll, I got this unexpected exception.


Environment

Windows 7 Pro x64; Ruby 2.0.0; Ruby Gems 2.0.3; Jekyll 1.0.3

Solution

By the –trace command in Jekyll, we can see the stack of the exception.

In this file:

"C:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\jekyll-1.0.3\lib\jekyll\convertible.rb"

(the path on my computer), change the code in line 29 from:

def read_yaml(base, name)
  begin
    self.content = File.read(File.join(base, name))

    ......
end

to:

def read_yaml(base, name)
  begin
    self.content = File.read(File.join(base, name), :encoding => "UTF-8")

    ......
end

DONE