I'm building a site using Jekyll and Jekyll Asset Pipeline and when I generate the site I get the following error:
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'
I'm really unsure as to what could be causing this. This is my compress.rb
plugin to facilitate the JS compression using YUI:
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
Your compress method has a typo in the arguments to new()
, correction below.
def compress
return YUI::JavaScriptCompressor.new(:munge => true).compress(@content)
end
I suspect this is an error in the jekyll-asset-pipeline documentation.