Sto migrando la mia app da Rails 3.0.9 a 3.2.3 e ruby 1.9.3. Stavo usando paperclip (2.3.11) con aws-s3 gem per memorizzare le mie immagini.Errori :: SignatureDoesNotMatch, gemma AWS-SDK per supporto S3 su paperclip 3.0.1 e rails 3.2
Ora voglio usare l'ultima versione di paperclip (3.0.1) e quindi devo usare aws-sdk gem.
Ho impostato il mio file aws.yml come:
development: &development
bucket: bucket_name_for_dev
access_key_id: *****
secret_access_key: *******
staging:
<<: *development
bucket: bucket_name_for_staging
production:
<<: *development
bucket: bucket_name_for_prod
mio modello contiene:
has_attached_file :picture, :styles => { :medium => "300x300>", :thumb => "50x50>" }, :default_url => 'picture_missing.png',
:storage => :s3,
:bucket => "bucket_name_for_dev",
:s3_credentials => Rails.root.join("config/aws.yml"),
:path => "/presentation_pictures/:id/:style/:filename",
:url => ":s3_eu_url"
attr_accessible :picture
attr_accessor :picture_url
Quando si cerca di caricare un file, ottengo l'errore:
AWS::S3::Errors::SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.
Ho verificato th le mie chiavi sono accessibili e impostate sul valore giusto.
Anche qui è quello che ho ottenere da console:
[paperclip] Saving attachments.
[paperclip] saving /presentation_pictures/43/original/Image_1.png
[AWS S3 200 0.813272 0 retries] put_object(:acl=>:public_read,:bucket_name=>"*******_dev",:content_type=>"image/png",:data=>#<Paperclip::UploadedFileAdapter:0x2e144b4 @target=#<ActionDispatch::Http::UploadedFile:0x2dbb1fc @original_filename="Image 1.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"presentation_picture[picture]\"; filename=\"Image 1.png\"\r\nContent-Type: image/png\r\n", @tempfile=#<File:/var/folders/tb/tbmv4LE9EwGNPr1QqU2S0E+++TI/-Tmp-/RackMultipart20120407-33502-1gajfe9>>, @tempfile=#<File:/var/folders/tb/tbmv4LE9EwGNPr1QqU2S0E+++TI/-Tmp-/Image 1.png20120407-33502-an4dcy>>,:key=>"presentation_pictures/43/original/Image_1.png")
Avete qualche idea da dove potrebbe venire questo problema? Thx
Non ho una risposta per te ma potresti pubblicare aws-sdk e aws-s3 versioni da Gemfile.lock? Sto cercando di capire perché questo abbia avuto inizio anche per me. –