我的这个项目跑在本地上好的,可以正常上传文件到 S3, 但是部署到 Ubuntu 14.04 的 VPS 之后,上传功能就出问题了。
https://github.com/springwq/photo_store
这是 production.log
1378 I, [2014-12-22T11:10:38.603482 #9603] INFO -- : Started POST "/admin/images" for 58.247.17.193 at 2014-12-22 11:10:38 +0800
1379 I, [2014-12-22T11:10:38.604527 #9603] INFO -- : Processing by Admin::ImagesController#create as HTML
1380 I, [2014-12-22T11:10:38.604633 #9603] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"+gM5W9BJBSep+g5woBi/sD7vS/GRxjN>
1381 I, [2014-12-22T11:10:44.860865 #9603] INFO -- : Completed 500 Internal Server Error in 6256ms
1382 F, [2014-12-22T11:10:44.862269 #9603] FATAL -- :.
1383 Excon::Errors::BadRequest (Expected(200) <=> Actual(400 Bad Request)
1384 excon.error.response
1385 :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AuthorizationHeaderMalformed</Code><Message>The autho>
1386 :headers => {
1387 "Connection" => "close"
1388 "Content-Type" => "application/xml"
1389 "Date" => "Mon, 22 Dec 2014 03:10:43 GMT"
1390 "Server" => "AmazonS3"
1391 "x-amz-id-2" => "DQ/eYeymGOTdePU0hOjf/Nfygqw6ZFMPwhkw80BXyIT56SI7JPAW/nuRuE2r9hlL"
1392 "x-amz-request-id" => "0B88D93FCA879D41"
1393 }
1394 :local_address => "106.185.29.213"
1395 :local_port => 52079
1396 :reason_phrase => "Bad Request"
1397 :remote_ip => "54.231.32.137"
1398 :status => 400
1399 ):
1400 app/controllers/admin/images_controller.rb:11:in `create'