Ruby
ruby安装与环境设置
-
安装Ruby
在https://rubyinstaller.org/上下载最新版(当前为2.4.1)的
ruby安装包。该安装包安装完成后会自动提示下载对应的msys2(其用于编译相关的gems)。 -
gems的安装第一个安装的
gems是bundler,安装后切换路径到对应的项目路径下,安装项目相关的gemsgem install bundler cd $prjoect_home$ bundle updatejekyll无法本地预览中文文件问题的解决
对ruby安装路径中的webrick/httpservlet/filehandler.rb文件打补丁:
# position 1
path = req.path_info.dup.force_encoding(Encoding.find("filesystem"))
+ path.force_encoding("UTF-8") # 加入编码
if trailing_pathsep?(req.path_info)
# positon 2
break if base == "/"
+ base.force_encoding("UTF-8") #加入編碼
break unless File.directory?(File.expand_path(res.filename + base))