0

I'm using Rich Editor for my Ruby on Rails app. And I'm have a problem when I'm deploying my code to Heroku. When I'm deploy new code to Heroku, all old assets removes. Also, all uploaded images by Rich Editor too removes. Maybe, I'm forgot to set some settings?

Thanks!

MrWEST
  • 158
  • 5
  • What version of rails? – trh Oct 17 '13 at 20:16
  • You talk about "uploaded images by Rich Editor" being removed, how and where are they being saved? The file system at Heroku isn't exactly writeable in a usable fashion. – mu is too short Oct 17 '13 at 20:34
  • Files be saved into `public/assets` folder by default. In the settings we can use account S3? Do you think it's better? – MrWEST Oct 17 '13 at 20:39
  • Anything that works would qualify as better, no? You can write whatever you want to `public/assets` but your changes will go away whenever the dyno is restarted and the dyno can be restarted whenever Heroku feels like it. – mu is too short Oct 18 '13 at 04:01

1 Answers1

0

There are multiple reasons for this kind of issue. Typically it is either has to do with the way Heroku precompiles the assets or that the CSS is not pointing to the proper file if the asset is stored on S3.

One such being this:

http://natashatherobot.com/rails-4-heroku-assets-not-found-css-image/

Another being this:

Can't get CSS working on Heroku using Rails 4 with bootstrap-sass gem

Edit

Okay. It looks like you need to change the way you are managing your assets.

One solution is to use S3. A good explanation on how to do that: https://devcenter.heroku.com/articles/s3

I haven't used this gem but it looks promising:
https://github.com/rumblelabs/asset_sync

Another solution is to keep your local asset file in synch with production. You could do this by pulling down a copy of your asset directory from heroku each time you do development.

Community
  • 1
  • 1
mpiccolo
  • 662
  • 5
  • 14
  • I'm don't have any errors, just all images uploaded by Rich Editor be removed when i'm deploy new code to Heroku. – MrWEST Oct 17 '13 at 20:23
  • What do you mean by removed? When you go to the page that displays the images they do not display but they do display locally? – mpiccolo Oct 17 '13 at 20:27
  • No. I'm upload images in admin-panel on production (Heroku). And when I'm made some changes locally and wanna to upload it to Heroku, all my images in production removes (Cleaning assets). – MrWEST Oct 17 '13 at 20:34
  • So you are making a change to an unrelated part of your app and when you push to heroku it is overwriting your public assets folder? – mpiccolo Oct 17 '13 at 20:49
  • Yeah! And all image uploaded by Rich File Manager just removes. – MrWEST Oct 17 '13 at 20:55