Debugging a clip on a Herek

I am building my first Heroku app and learn how to use rails at the same time. I built a very simple model and added the “Paperclip” gem to my assembly. It works on my local host (although it doesn't seem to upload files), however, when deployed to Heroku in the “new” form, I just get:

We are sorry, but something went wrong.

We have been notified of this problem and we will look at it soon.

I can’t figure out where to start this debugging. My gemfile contains the gem string 'paperclip'

+4
source share
3 answers

Heroku has a read-only file system. This means that Paperclip cannot save downloaded files anywhere in Heroku.

If you want to upload files to an application hosted on Heroku, you must either store the files as binary drops in your database, or you must use a separate service to store the files. If you're looking for a standalone service, Paperclip has built-in integration support with Amazon S3.

See relevant Heroku docs .

+2
source

Heroku magazines do not always help.

For your purposes, since you are just getting started, I would recommend setting your heroku application to “development mode” so that you can see detailed error messages.

heroku config # Should return a list of your current environment, including RACK_ENV=production heroku config:add RACK_ENV=development # now you'll get verbose error messages heroku config:add RACK_ENV=production # set this back when you're done debugging 

This should help! Share the bug report with us and maybe we can help more.

+5
source

You can run heroku logs on the command line to get your application log files.

Of course, you will find your answer there.

0
source

Source: https://habr.com/ru/post/1337487/


All Articles