Precompile
To give you some clearer definitions - Heroku
isn't the only system which requires you to "precompile" your assets. Asset precompilation is a pre-requisite of most Rails production environments, as it allows you to serve static assets (files) - perfect for speed & efficiency
Here's what the Rails documentation says about it:
In the production environment Sprockets uses the fingerprinting scheme
outlined above. By default Rails assumes assets have been precompiled
and will be served as static assets by your web server.
During the precompilation phase an MD5 is generated from the contents
of the compiled files, and inserted into the filenames as they are
written to disc. These fingerprinted names are used by the Rails
helpers in place of the manifest name.
The reason why Heroku wants you to precompile your assets is because the Heroku environment is designed for speed & efficiency; and hence does not want to expend CPU power on compiling the assests for each request / instanace of your app
This means you have to either precompile the assets yourself, or let the Heroku buildpacks sort that out for you
Heroku
As mentioned by CWitty
, you'll want to make sure you compile your assets locally. And whilst I'm not sure about the errors you've received, I do know one thing: precompilation populates the public/assets
folder
This means if you precompile locally before submitting to Heroku, you'll have all your latest assets present in your public/assets
directory before you try and run the application on Heroku
Although Heroku does perform precompilation as part of the build process, you'll be much safer (from an exception perspective) by precompiling locally:
$ rake assets:precompile RAILS_ENV=production
This will give you the ability to populate the public/assets
folder, allowing you to then push to Heroku without any issues