When running:
rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
Everything precompiles but not my /app/assets/images/*
I even tried adding this to my environment/production.rb
config.assets.paths << "#{Rails.root}/app/assets/images"
What's wrong? thanks!
We use rake assets:precompile to precompile our assets before pushing code to production. This command precompiles assets and places them under the public/assets directory in our Rails application. Let's begin our journey by looking at the internals of the Rails Asset Pipeline. This article is based on Rails 3.2.
The Rails asset pipeline provides an assets:precompile rake task to allow assets to be compiled and cached up front rather than compiled every time the app boots. There are two ways you can use the asset pipeline on Heroku. Compiling assets locally. Compiling assets during slug compilation.
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.
Found a solution: Add to environment/production.rb
config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif]
Why isn't this default ;ike this line says: (application.js, application.css, and all non-JS/CSS are already added)
Use this format for the server:
rails assets:precompile:all -e production
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