您的位置:首页 > 产品设计 > UI/UE

[jekyll] 乱码问题invalid byte sequence in GB2312

2014-05-05 22:56 302 查看
这里是windows下 使用1.4.3版本时候出现的问题。
问题1 
I:\git\orangle.github.io>jekyll serve --watch
Configuration file: I:/git/orangle.github.io/_config.yml
Source: I:/git/orangle.github.io
Destination: I:/git/orangle.github.io/_site
Generating... Error reading file I:/git/orangle.github.io/_layouts/default
.html: invalid byte sequence in GB2312
Error reading file I:/git/orangle.github.io/_layouts/index.html: invalid byte se
quence in GB2312
Error reading file I:/git/orangle.github.io/_layouts/post.html: invalid byte seq
uence in GB2312
Error reading file I:/git/orangle.github.io/_posts/2013-12-28-Cracking-the-Codin
g-Interview-1-3.md: invalid byte sequence in GB2312
error: invalid byte sequence in GB2312. Use --trace to view backtrace
网上查到配置.bash_profile方法,然后 不好用,修改jekyll代码的方式应该是比较老的版本,新版本有点不一样,由于ruby不熟悉就没尝试。

问题2
这使用在命令行设置环境变量的办法
I:\git\orangle.github.io>set LC_ALL=en_US.UTF-8

I:\git\orangle.github.io>set LANG=en_US.UTF-8

I:\git\orangle.github.io>jekyll serve
Configuration file: I:/git/orangle.github.io/_config.yml
Source: I:/git/orangle.github.io
Destination: I:/git/orangle.github.io/_site
Generating... D:/devsofts/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3
.8/lib/posix/spawn.rb:162: warning: cannot close fd before spawn
'which' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
error: Invalid argument - I:/git/orangle.github.io/_site/I:. Use --trace to view
backtrace

这次找到的答案是修改jekyll版本
gem uninstall jekyll

gem install jekyll --version "=1.4.2"

最后还是会有错,但是可以启动服务了。
I:\git\orangle.github.io>jekyll server
Configuration file: I:/git/orangle.github.io/_config.yml
Source: I:/git/orangle.github.io
Destination: I:/git/orangle.github.io/_site
Generating... D:/devsofts/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3
.8/lib/posix/spawn.rb:162: warning: cannot close fd before spawn
'which' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
done.
Server address: http://0.0.0.0:4000 Server running... press ctrl-c to stop.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  windows ruby jekyll 乱码