ho ottenuto le seguenti indietro da delayed_job:URI non valido - Come prevenire, URI :: ErralidURIError errori?
[Worker(XXXXXX pid:3720)] Class#XXXXXXX failed with URI::InvalidURIError: bad URI(is not URI?): https://s3.amazonaws.com/cline-local-dev/2/attachments/542/original/mac-os-x[1].jpeg?AWSAccessKeyId=xxxxxxxx&Expires=1295403309&Signature=xxxxxxx%3D - 3 failed attempts
Il modo in cui questo viene da URI nella mia app è.
Nel mio user_mailer faccio:
@comment.attachments.each do |a|
attachments[a.attachment_file_name] = open(a.authenticated_url()) {|f| f.read }
end
Poi nel mio allegati modello:
def authenticated_url(style = nil, expires_in = 90.minutes)
AWS::S3::S3Object.url_for(attachment.path(style || attachment.default_style), attachment.bucket_name, :expires_in => expires_in, :use_ssl => attachment.s3_protocol == 'https')
end
Detto questo, c'è un certo tipo di URI.encode o analisi che posso fare per evitare un URI valido (come ho verificato l'URL funziona nel mio browser) per errore e uccisione delayed_job in rails 3?
Grazie!
ho provato 'open (URI.parse (URI.encode (a.authenticated_url()))', ma che errord con OpenURI :: HTTPError: 403 Forbidden – AnApprentice
Tale errore non significa che l'URL è cattivo, significa che la pagina non è disponibile per te. –