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

这里是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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值