0

I developed my app with Refinery and I just deployed to Heroku. Everything works, except the images that were added to the pages through the CMS. To be more clear, the ones uploaded locally using the route:

edit page > add image > upload > choose files > save > insert

The steps that I took for deployment were:

# push to repo
git push heroku master
# reset DB
heroku pg:reset HEROKU_POSTGRESQL_SILVER_URL
PGUSER=rails PGPASSWORD=rails heroku pg:push default_dev HEROKU_POSTGRESQL_SILVER_URL --app app-name-0000

Everything seems to go smooth, except for:

  1. The images uploaded to the CMS locally are missing/broken in Heroku.

I don't know if it is relevant, but the final output that I get is this:

...
pg_restore: setting owner and privileges for INDEX index_refinery_users_on_slug
pg_restore: setting owner and privileges for INDEX index_seo_meta_on_id
pg_restore: setting owner and privileges for INDEX unique_schema_migrations
WARNING: errors ignored on restore: 1

I assumed that the images are stored in the database, so they should be pushed as well, right?

There is no problem with the app or the database, as I can use the CMS to re-upload each image to the pages that needs them.

Please point me into the right direction.

givanse
  • 14,503
  • 8
  • 51
  • 75
  • exact duplicate of [Updating app on Heroku without loosing link to images](http://stackoverflow.com/questions/17521683/updating-app-on-heroku-without-loosing-link-to-images) – givanse Dec 30 '13 at 06:16

1 Answers1

1

I think you need to serve assets through Amazon S3. Check out this guide. Whomever wrote it is a hero, and explains the whole process pretty well. You'll need to set up a bucket on Amazon AWS and provide the access info to heroku, and do some funny business with asset pre-compilation. I'd be very interested to know if you can get your images to work without following the instructions on the linked page.

Community
  • 1
  • 1
aidan
  • 1,627
  • 17
  • 27