我正在使用 Jekyll 和Jekyll Asset Pipeline构建站点,当我生成站点时出现以下错误:
Configuration from /home/liamzebedee/Documents/blog/_config.yml
Building site: /home/liamzebedee/Documents/blog -> /home/liamzebedee/Documents/blog/_site
Asset Pipeline: Processing 'css_asset_tag' manifest 'global'
Asset Pipeline: Saved 'global-209b6871f359105f20dc61685687e480.css' to '/home/liamzebedee/Documents/blog/_site/assets'
Asset Pipeline: Processing 'javascript_asset_tag' manifest 'global'
Asset Pipeline: Failed to compress 'global-31b4b6cd8ed5427ca98bb8f30ce0e75e.js' with 'JekyllAssetPipeline::JavaScriptCompressor'.
Liquid Exception: undefined method `exitstatus' for nil:NilClass in content
/var/lib/gems/1.9.1/gems/yui-compressor-0.9.6/lib/yui/compressor.rb:84:in `block in compress'
/var/lib/gems/1.9.1/gems/yui-compressor-0.9.6/lib/yui/compressor.rb:117:in `streamify'
/var/lib/gems/1.9.1/gems/yui-compressor-0.9.6/lib/yui/compressor.rb:66:in `compress'
我真的不确定是什么原因造成的。这是我compress.rb
使用 YUI 促进 JS 压缩的插件:
require 'jekyll_asset_pipeline'
module JekyllAssetPipeline
class JavaScriptCompressor < JekyllAssetPipeline::Compressor
require 'yui/compressor'
def self.filetype
'.js'
end
def compress
return YUI::JavaScriptCompressor.new(munge: true).compress(@content)
end
end
end