0.6.3 undefined option :compilation_level #181

Closed
sreid99 opened this Issue May 26, 2011 · 9 comments

Comments

Projects
None yet
10 participants

sreid99 commented May 26, 2011

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 Jun 8, 2011

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 Jun 15, 2011

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

Same issue.

Same issue.

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 Sep 19, 2011

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

Thanks @bkabrda that worked for me!

Thanks @bkabrda that worked for me too!

Owner

jashkenas commented Nov 27, 2012

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

@jashkenas jashkenas closed this Nov 27, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment