Windows 版本: 10.0
Ruby 版本: 2.5.1
Gem 版本: 2.7.6
Jekyll 版本: 3.8.3
Bundle 版本: 1.16.2
Powershell 版本: 5.1css
Code Page: In computing, a code page is a table of values that describes the character set used for encoding a particular set of characters, usually combined with a number of control characters.
从Wiki的描述来看,Code Page至关于字符编码集合构成的页表。shell
那么,在Win10系统中安装Jekyll容易出现Code Page的错误,亦即不一样的字符集编码不兼容。windows
错误表现:
运行:bundle exec jekyll serve
报错:
Conversion error: JekyllConverters::Scss encountered an error while converting 'assets/css/main.scss':
Invalid GBK character "xE2" on line 54编码
查看当前系统的Code Page方法有两种:code
chcp
,显式Active code page: 65001,即Code Page为65001 (UTF-8),此时Jekyll能够正常运行;若查看到的Code Page为:936 (GBK),则会与Jekyll出现字符集不兼容的问题。get
修改当前系统的Code Page方法:scss
chcp 65001
,可是退出Powershell以后,将恢复默认的Code Page,故而每次在运行bundle exec jekyll serve
命令时候,都须要进行chcp 65001
;长久方法:修改Powershell配置文件。it
Get-ExecutionPolicy
获取当前Powershell执行策略等级;Set-ExecutionPolicy RemoteSigned
修改策略等级为RemoteSignedNew-Item -Path $Profile -ItemType file -Force
chcp 65001
命令写入,而后保存退出文件;chcp 65001
;chcp 65001 >$null
,将输出丢弃;以上的解决方案,主要参考setup-jekyll-on-windowsio