99miles
99miles

Reputation: 11232

assets:precompile tries to compile a sass partial when it shouldn't

Any idea why Rails' assets:precompile would try to compile a sass partial _accounts.css.sass when it's not listed in my precompile list?

application.rb

config.assets.enabled = true
config.assets.initialize_on_precompile = true

config.assets.precompile += ['*.js', 'controllers/*.js', 'controllers/admin/*.js', 'controllers/shared/*.js', '*.coffee', 'application.css.sass', '*.css', '*.png', '*.jpg', '*.scss.erb']

_accounts.css.sass is only included by application.css.sass which has:

@import "account"

The error is:

Undefined mixin 'column'. (in _account.css.sass)

...because it uses compass, but the application.css.sass imports compass before importing _accounts.css.sass, so the partial shouldn't need to import compass.

Upvotes: 1

Views: 1475

Answers (1)

Frederick Cheung
Frederick Cheung

Reputation: 84182

The file names/patterns in the list of things to precompile do not refer to the filenames of things to precompile. Instead they refer to the results of precompilation i.e. asking for '*.css' to be precompiled means precompile anything that if compiled would result in a .css file. In particular, a .css.sass file like your _account file will be precompiled.

Upvotes: 2

Related Questions