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

来源:互联网 发布:知乎filco红轴 编辑:程序博客网 时间:2024/05/20 01:39

这里是windows下 使用1.4.3版本时候出现的问题。

问题1 

I:\git\orangle.github.io>jekyll serve --watchConfiguration 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 GB2312Error reading file I:/git/orangle.github.io/_layouts/index.html: invalid byte sequence in GB2312Error reading file I:/git/orangle.github.io/_layouts/post.html: invalid byte sequence in GB2312Error reading file I:/git/orangle.github.io/_posts/2013-12-28-Cracking-the-Coding-Interview-1-3.md: invalid byte sequence in GB2312error: 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 serveConfiguration 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 serverConfiguration 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.


0 1
原创粉丝点击