I have a web app working on heroku right now, I configure my app to stored in assets the fav-icon and company logo that I and use only in the login.
The problem is that Im trying to use activestorage and aws s3 to start uploading images of my employees in heroku.
I follow all documentation to use activestorage and all docs about how to configure Heroku and AWS S3.
runing my app local works with activestorage and s3 I can upload images to my S3 bucket and all looks great, the problem is when I try to deploy this version to heroku the upload (when i use "git push heroku master") don't mark any error but when i try to access my app my app these do not work.
My heroku logs show me
2020-03-27T16:38:47.835694+00:00 app[web.1]: from bin/rails:9:in `<main>'
2020-03-27T16:38:47.889395+00:00 app[web.1]: => Booting Puma
2020-03-27T16:38:47.889418+00:00 app[web.1]: => Rails 5.2.4.1 application starting in production
2020-03-27T16:38:47.889419+00:00 app[web.1]: => Run `rails server -h` for more startup options
2020-03-27T16:38:47.889419+00:00 app[web.1]: Exiting
2020-03-27T16:38:57.236728+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/admin/client" host=admin.ttpn.com.mx request_id=6568febe-d894-4751-bf2c-c6d8d1539146 fwd="189.237.90.141" dyno= connect= service= status=503 bytes= protocol=https
My employee model have the fields to use with railsandmin and the code to use activestorage :
class Employee < ApplicationRecord
has_one_attached :avatar
attr_accessor :remove_avatar
after_save { avatar.purge if remove_avatar == '1' }
The rails_admin configuration to use images is:
rails_admin do
create do
field :avatar, :active_storage
field ...
end
edit do
field :avatar, :active_storage do
delete_method :remove_avatar
end
field ...
end
end
end
My storege.yml code is:
local:
service: S3
access_key_id: <%= Rails.application.credentials.amazon[:access_key_id] %>
secret_access_key: <%= Rails.application.credentials.amazon[:secret_access_key] %>
region: <%= Rails.application.credentials.test[:region] %>
bucket: <%= Rails.application.credentials.test[:bucket] %>
amazon:
service: S3
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
region: us-east-2
bucket: <%= ENV['BUCKET_NAME'] %>
All ENV[] variable are configured right now in Heroku.
Some one can help me to found a solution why my app dont work in heroku
Tks