I want to manually precompile some assets in my dev environment (to check the content of the compiled js and css files) from the command line.
I am running
RAILS_ENV=development bundle exec rake assets:precompile
but my js and css are not compiled in the public/assets folder, only the images are. Any idea why that may be happening?
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.
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB. Prior to Rails 3.1 these features were added through third-party Ruby libraries such as Jammit and Sprockets.
The clean it removes the old versions of the precompiled assets while leaving the new assets in place. Show activity on this post. rake assets:clean removes compiled assets. It is run by cap deploy:assets:clean to remove compiled assets, generally from a remote server.
Try adding this to your config/environments/production.rb
:
config.assets.precompile += %w( *.css *.js )
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