9

I have read through all the comments and issues I can find here, but none of them seem to apply to my situation. I have a Ruby on Rails back-end, with React front-end that was deploying fine until I added the ability for an admin to update databases via a CSV file using ActiveRecord.

When I push to Heroku, I now get two warnings:

###### WARNING: Detecting rails configuration failed
##### WARNING: We detected that some binary dependencies required to use all the preview features of Active Storage are not present on this system.

I have gone through the provided Heroku articles on active storage on Heroku, but I am still not able to solve the problem.

Trying to trouble shoot on the Rails console, I get the following error that might be the culprit:

/app/vendor/bundle/ruby/2.5.0/gems/aws-partitions-1.144.0/lib/aws-partitions/endpoint_provider.rb:82:in block in partition_matching_region: Cannot load Rails.config.active_storage.service: (NoMethodError) undefined method match for nil:NilClass

Does anybody have any insight into this problem? I am running into the same stuff that others are discovering: some of these error messages are not the most insightful for me. Thank you!

3 Answers 3

4

You need to install Heroku's ActiveStorage Previews Buildpack:

heroku buildpacks:add -i 1 https://github.com/heroku/heroku-buildpack-activestorage-preview 

This will install the binary tools necessary to generate the asset previews. More information is available here:

Sign up to request clarification or add additional context in comments.

1 Comment

I am a step closer! That removed the warning about binary dependencies, but I am still getting the rails configuration failure, with the same error in the rails console on Heroku. Thanks for the insight on the buildpack! One less warning is a small sucess.
0

https://github.com/aws/aws-sdk-ruby/issues/1240 looks like your issue:

This means you haven't configured a region. To configure a region, set the AWS_REGION environment variable, or pass it in as a parameter. For example:

key = OpenSSL::PKey::RSA.new(1024) s3 = Aws::S3::Encryption::Client.new(encryption_key: key, region: "us-east-1") # or the region you are using 

2 Comments

I saw this response and tried updating my config/intializers/aws.rb file as: Aws.config.update({ region: 'us-west-2', credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']), }) Am I way off base here?
That looks like it makes sense to me but no way for me to check - I'd try the commands from the above post and see if they work
0

Another way to resolve this issue is to first get a detailed error log with this command:

heroku run rails console 

If there are no errors, you will enter the interactive Ruby shell otherwise you should see the cannot load active storage service error.

If you're using S3, you'll have to set the access key, secret access key, bucket name and bucket region:

SECRET_KEY_BASE:xxx-xxx-xxxxxx-xxx-xxxxxx-xxx-xxx

AWS_ACCESS_KEY_ID: xxx-xxx-xxx

AWS_SECRET_ACCESS_KEY: xxx-xxx-xxxxxx-xxx-xxx

S3_BUCKET_NAME: xxx-xxx-xxx

AWS_BUCKET_REGION: us-east-1

Then load your environment variables to Heroku with: figaro heroku:set -e production

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.