documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

0.6.3 undefined option :compilation_level #181

Closed sreid99 closed 11 years ago

sreid99 commented 13 years ago

I get

YUI::Compressor::OptionError in Devise/sessions#new
undefined option :compilation_level 

in a view containing the line :

<%= include_stylesheets :common, :media => 'all' %>

This happens when I have assets.yml :

package_assets:         off
embed_assets:           off
compress_assets:        off
gzip_assets:            off
template_function:      off
package_path:           packages
javascript_compressor:  closure
compressor_options:
   compilation_level: ADVANCED_OPTIMIZATIONS

javascripts:
  common:
    - public/javascripts/*.js

stylesheets:
  common:
    - public/stylesheets/*.css

but if I set package_assets to always the error goes away. Not sure why the error refers to YUI::Compressor when I've got closure in my settings. I thought maybe it wasn't finding my assets.yml file, but then found changing package_assets does make a difference...

Pretty sure this has only happened since I upgraded to the new version.

RaVbaker commented 13 years ago

I have the same issue after updating to jammit to 0.6.3 where dependency yui-compressor (>= 0.9.3) updates yui-compressor to version 0.9.6.

When I turned off these two lines in my assets.yml:

compressor_options:
compilation_level: ADVANCED_OPTIMIZATIONS

It works now. But I still cannot understand the bug with YUI when I'm using:

javascript_compressor:  closure

not yui. :/

glebm commented 13 years ago

Same issue here Turning off these 2 lines disables advanced js optimizations so it is highly undesirable YUI compressor is used to compress CSS, not js

svanderbleek commented 12 years ago

Same issue.

shakerlxxv commented 12 years ago

Same issue.

artob commented 12 years ago

We experienced the same issue. The workaround was to remove the compilation_level in config/assets.yml, as described in a previous comment from @RaVbaker.

bkabrda commented 12 years ago

I've been investigating this issue and it seems that you need to install rubygem closure-compiler in order for this to work properly.

johnagan commented 12 years ago

Thanks @bkabrda that worked for me!

vietnogi commented 11 years ago

Thanks @bkabrda that worked for me too!

jashkenas commented 11 years ago

Right -- sorry about that. As stated in the documentation, compilation_level only applies to the closure compiler. Other compressors don't have that option.