After I upgrade to Rails 3.1.0 from Rails 3.1.0.rc6, I got some error messages when running assets:precompile
task like this:
$ RAILS_ENV=production RAILS_GROUPS=assets rake assets:clean tmp:clear assets:precompile
rake aborted!
ie-spacer.gif isn't precompiled
(in app/assets/stylesheets/jquery.gritter.css.scss)
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I tried add config.assets.precompile << 'ie-spacer.gif'
to config/application.rb
, but it still fails.
The line in jquery.gritter.css.scss
is:
background: asset_url('ie-spacer.gif', image);
and I tried:
background: asset_path('ie-spacer.gif', image);
background: image_url('ie-spacer.gif');
background: image_path('ie-spacer.gif');
all failed with ie-spacer.gif isn't precompiled
.
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
rails assets:precompile is the task that does the compilation (concatenation, minification, and preprocessing). When the task is run, Rails first looks at the files in the config.assets.precompile array. By default, this array includes application.js and application.css .
You have to do
config.assets.compile = true
during the assets:precompile task.
Seems to be a bug in rails 3.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With