I've deployed a rails app to heroku, it was working just fine until I changed domains, locally it works fine and now I've started getting the following error: Paperclip::Errors::MissingRequiredValidatorError
.
the s3 env variables are set on heroku and I can't find why this error occurs, help is appreciated.
EDIT: for future reference, it had nothing to do with heroku, once re-bundling, it'll throw the same error locally, as the answer suggest.
Other errors, such as application errors (a 404 or 500), will display your application’s error page and not the Heroku error page. Only system-level errors that result in no response, or a malformed one, will display the Heroku error page discussed here.
Heroku’s HTTP router serves unstyled HTML with HTTP status code 503 (Service Unavailable) when your app encounters a system-level error, or while maintenance mode is enabled. Other errors, such as application errors (a 404 or 500), will display your application’s error page and not the Heroku error page.
You may wish to use the default HTML served by Heroku as a template: You can reference images or CSS from the HTML as long as you use relative paths (for example, <img src="error.png">) and you upload the other assets into the same place as the HTML. You can host the pages anywhere that can serve web pages.
A heroku logs –tail session cannot keep up with the volume of logs generated by the application or log channel, and Logplex has discarded some log lines necessary to catch up.
With version 4.0 (published 2 days ago) Paperclip requires file/mime validation. Simply add the following to your model:
validates_attachment_content_type :file_name, :content_type => %w(image/jpeg image/jpg image/png)
IMPORTANT: replace file_name and content type so that it fits your project.
It works locally because you probably have not updated paperclip yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With