我有以下的production.rb配置
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Choose the compressors to use
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :yui
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs.
config.assets.digest = true
但是,当在Ruby的生产服务器上的Rails应用程序,我得到以下错误:
Error compiling CSS asset
LoadError: cannot load such file -- yui-compressor
在注释行LoadError: cannot load such file -- yui-compressor
,一切顺利。
所有我需要gzip压缩发送来提高性能之前压缩资产压缩机!
所以,这里有什么问题或有任何其他的选择吗?
更新:
也JavaScript的压缩不工作时,作为用于Firefox也表示Javascript角YSlow的插件需要被压缩。