Wrap @cleaned_text ||= rta.to_text.gsub(/\n+/, ' ') in a rescue block to catch RubyTikaApp::CommandFailedError. This is within the #cleaned_text function in MetadataListener::Service::Tika.
This function is parsing text from a file, so it's prone to errors that we can't really do anything about.