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.

Kirti Thorat
  • 52,578
  • 9
  • 101
  • 108
Dave
  • 1,051
  • 1
  • 10
  • 20
  • There is an open issue for this: https://github.com/heroku/heroku-buildpack-ruby/issues/123 – Austin Feb 14 '14 at 02:55
  • @Dave did you get this working in the end? Im having trouble getting assets to my bucket as precompile is always saving to my public folder? – Richlewis Mar 03 '14 at 18:37
  • I just experience the same issue. Did you find any solution for this? – rit Aug 01 '14 at 14:33
  • 1
    @rit I talked to heroku about it and it appeared to be an issue on their end, probably best to get in touch with them again and see when they plan on fixing it. – Dave Aug 07 '14 at 07:02

0 Answers0