2

I'm having some problems with assets on Heroku (rails) and am hoping someone can point me in the right direction. I've got the asset_sync gem installed, and after many hours of debugging I've finally got it working. However, when I first run (with an empty S3 bucket) "git push heroku master", I get about 4 copies of every file uploaded to s3 (each with a different hash appended). Also, somehow a lot of files I previously deleted (and are no longer in my app/assets/images directory) are still somehow getting uploaded. I've deleted the public/assets folder on my local copy & pushed to git, but perhaps that folder is still there on heroku? How do I debug this? I want my assets to be properly sync'd, so if I delete an image while developing locally, it will also be removed from s3 when I next deploy.

Another possibly related problem, my static error pages (public/404.html) are not getting served on heroku, yet work fine on development- are these static html files treated as assets and meant to be uploaded to S3 too?

Running heroku run rake assets:precompile does nothing. My asset_sync.rb initializer is:

if defined?(AssetSync)
  AssetSync.configure do |config|
    config.fog_provider = 'AWS'
    config.aws_access_key_id = 'key'
    config.aws_secret_access_key = 'key'
    config.fog_directory = 'bucketname'
    config.fog_region = 'us-east-1'
    config.existing_remote_files = "delete"
  end
end

I know I should be using environment variables but it shoudln't make any difference hardcoding my access details at least while I'm testing

Thanks for any help.

4

0 回答 0