现在我尝试在Windows系统上使用Octopress。当我写博客并运行时
bundle exec rake generate
我收到了这些错误:
user@USER-PC /c/Sites/my_project (master)
$ bundle exec rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from c:/Sites/my_project/_config.yml
Building site: source -> public
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.11.0/lib/jekyll/convertible.rb:29:i
n `read_yaml': invalid byte sequence in GBK (ArgumentError)
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.11.0/lib/jekyll/post.r
b:39:in `initialize'
from c:/Sites/my_project/plugins/preview_unpublished.rb:23:in `new'
from c:/Sites/my_project/plugins/preview_unpublished.rb:23:in `block
in read_posts'
from c:/Sites/my_project/plugins/preview_unpublished.rb:21:in `each'
from c:/Sites/my_project/plugins/preview_unpublished.rb:21:in `read_
posts'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.11.0/lib/jekyll/site.r
b:128:in `read_directories'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.11.0/lib/jekyll/site.r
b:98:in `read'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.11.0/lib/jekyll/site.r
b:38:in `process'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.11.0/bin/jekyll:250:in
`<top (required)>'
from c:/Ruby193/bin/jekyll:19:in `load'
from c:/Ruby193/bin/jekyll:19:in `<main>'
user@USER-PC /c/Sites/my_project (master)
$
似乎编码是错误的。如何更改呢?
答案 0 :(得分:1)
请设置 LC_ALL 和 LANG 。
set LC_ALL=en_US.UTF-8
set LANG=en_US.UTF-8