'ActiveStorage::IntegrityError (Must supply api_key)

I have been building a Rails app with image uploads for user avatars and until now there were no problems. The app is hosted on Heroku and the service I am using for images is Cloudinary. Because the app was previously hosted on a Heroku account that is no longer available, I created a new app from scratch. I did not make any changes in the code before pushing to the new location. The image upload is no longer working. Heroku logs give me the following error:

Completed 500 Internal Server Error in 338ms (ActiveRecord: 19.9ms | Allocations: 7494)

ActiveStorage::IntegrityError (Must supply api_key)

Any ideas how to troubleshoot from here?



Solution 1:[1]

The solution was to provide the Cloudinary API key as a Heroku config variable.

heroku config:set CLOUDINARY_URL=xxxxxxxx

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ?aean