My understanding of new Rails 3.1 asset pipeline in production mode is as follows:->
- config.action_controller.asset_host =
"https://mybucket.s3.amazonaws.com"
- config.assets.compile = false
app/assets
are checked into repo- bundle exec rake assets:precompile and sync with S3 (all assets)
public/assets
is NOT checked into repo
With all the above, I thought Rails would look for all the assets on S3 and I don't need them in the repository. Or at least I don't need the precompiled assets in public/assets
in the repo.
I have found this, on heroku, if don't have config.assets.compile = true
, it flat out will not find the precompiled assets on S3. And heroku must run through a compiling phase for all assets, but then will server them out of S3. Running heroku run rake assets:precompile
doesn't do squat. The production process will re-compile everything again.
Huh? That makes no sense to me.
I would make sense to me that you do not need to fill your repo with images, let your CDN do the work.
I have a feeling this is incorrect. Am I right or wrong?
public/assets
on the production server in order for it to "know" the assets have been compiled. Therefore, your assets must be duplicated in your repo, once inapp/assets
andpublic/assets
. Is this correct? – Karl