求前辈帮忙🙏
按照 ruby on rails tutorila 的11.4.4: Image upload in production步骤,实作了在上产环境中上传图片的功能。
但是当实际使用时发现了下面的报错:
然后在终端运行:
heroku logs
产生如下 logs:
2018-02-10T08:36:22.160097+00:00 app[web.1]: I, [2018-02-10T08:36:22.160009 #6] INFO -- : [b40b838f-613a-492a-b995-ee09f56c4443] Completed 200 OK in 20ms (Views: 11.8ms | ActiveRecord: 1.1ms)
2018-02-10T08:36:22.333445+00:00 heroku[router]: at=info method=GET path="/assets/rails-c094bc3a4bf50e5bb477109e5cb0d213af27ad75b481c4df249f50974dbeefe6.png" host=sample-app-180103.herokuapp.com request_id=aff85d8b-ef58-43ea-8e59-14c1d54fdadb fwd="54.167.204.162,66.102.7.132" dyno=web.1 connect=1ms service=3ms status=200 bytes=13232 protocol=https
2018-02-10T08:36:22.335622+00:00 heroku[router]: at=info method=GET path="/assets/application-30bba49027f3cb704192910ffbdb5f2e567bc29d091a86128f922104fbf13bf1.css" host=sample-app-180103.herokuapp.com request_id=255ae3e7-b419-415a-87c5-c985ba30195c fwd="54.167.204.162,66.102.7.135" dyno=web.1 connect=1ms service=10ms status=200 bytes=21197 protocol=https
2018-02-10T08:36:22.342813+00:00 heroku[router]: at=info method=GET path="/assets/application-ab447df98d0a8f179077b6934860dfcb7113a267fd726f9d9bd922d749f89f5d.js" host=sample-app-180103.herokuapp.com request_id=52e9676e-b94f-47ea-909f-798904de5c32 fwd="54.167.204.162,66.102.7.143" dyno=web.1 connect=1ms service=8ms status=200 bytes=57004 protocol=https
2018-02-10T08:36:22.523169+00:00 heroku[router]: at=info method=GET path="/" host=sample-app-180103.herokuapp.com request_id=48a07dcb-ab9f-4fa1-a721-ac885afb8a8c fwd="54.167.204.162,66.249.83.88" dyno=web.1 connect=0ms service=66ms status=200 bytes=2841 protocol=https
2018-02-10T08:36:22.614651+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=sample-app-180103.herokuapp.com request_id=c99b9cbe-b08d-46b4-9aa2-c9c6df595cca fwd="54.167.204.162,66.249.83.82" dyno=web.1 connect=0ms service=16ms status=200 bytes=207 protocol=https
2018-02-10T08:36:22.458263+00:00 app[web.1]: I, [2018-02-10T08:36:22.458156 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Started GET "/" for 66.249.83.88 at 2018-02-10 08:36:22 +0000
2018-02-10T08:36:22.459034+00:00 app[web.1]: I, [2018-02-10T08:36:22.458957 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Processing by StaticPagesController#home as HTML
2018-02-10T08:36:22.465205+00:00 app[web.1]: I, [2018-02-10T08:36:22.465096 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Rendering static_pages/home.html.erb within layouts/application
2018-02-10T08:36:22.473361+00:00 app[web.1]: D, [2018-02-10T08:36:22.473229 #9] DEBUG -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] User Load (4.8ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT $1 [["LIMIT", 1]]
2018-02-10T08:36:22.475477+00:00 app[web.1]: I, [2018-02-10T08:36:22.475391 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Rendered static_pages/_if_log_out_part.html.erb (0.9ms)
2018-02-10T08:36:22.475821+00:00 app[web.1]: I, [2018-02-10T08:36:22.475745 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Rendered static_pages/home.html.erb within layouts/application (10.5ms)
2018-02-10T08:36:22.501860+00:00 app[web.1]: I, [2018-02-10T08:36:22.476721 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Rendered layouts/_rails_default.html.erb (0.7ms)
2018-02-10T08:36:22.502318+00:00 app[web.1]: I, [2018-02-10T08:36:22.502215 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Rendered layouts/_shim.html.erb (0.1ms)
2018-02-10T08:36:22.503848+00:00 app[web.1]: D, [2018-02-10T08:36:22.503765 #9] DEBUG -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] CACHE User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT $1 [["LIMIT", 1]]
2018-02-10T08:36:22.504193+00:00 app[web.1]: I, [2018-02-10T08:36:22.504106 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Rendered layouts/_header.html.erb (1.6ms)
2018-02-10T08:36:22.504697+00:00 app[web.1]: I, [2018-02-10T08:36:22.504624 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Rendered layouts/_footer.html.erb (0.2ms)
2018-02-10T08:36:22.521500+00:00 app[web.1]: I, [2018-02-10T08:36:22.521327 #9] INFO -- : [48a07dcb-ab9f-4fa1-a721-ac885afb8a8c] Completed 200 OK in 62ms (Views: 51.8ms | ActiveRecord: 4.8ms)
2018-02-10T08:36:31.959231+00:00 heroku[router]: at=info method=GET path="/" host=sample-app-180103.herokuapp.com request_id=009217a0-f248-4911-af84-a209bf3c141f fwd="54.167.204.162" dyno=web.1 connect=0ms service=21ms status=200 bytes=4452 protocol=https
2018-02-10T08:36:31.938403+00:00 app[web.1]: I, [2018-02-10T08:36:31.938312 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Started GET "/" for 54.167.204.162 at 2018-02-10 08:36:31 +0000
2018-02-10T08:36:31.939194+00:00 app[web.1]: I, [2018-02-10T08:36:31.939114 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Processing by StaticPagesController#home as HTML
2018-02-10T08:36:31.942044+00:00 app[web.1]: D, [2018-02-10T08:36:31.941925 #9] DEBUG -- : [009217a0-f248-4911-af84-a209bf3c141f] User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 102], ["LIMIT", 1]]
2018-02-10T08:36:31.946500+00:00 app[web.1]: I, [2018-02-10T08:36:31.946397 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendering static_pages/home.html.erb within layouts/application
2018-02-10T08:36:31.949958+00:00 app[web.1]: D, [2018-02-10T08:36:31.949851 #9] DEBUG -- : [009217a0-f248-4911-af84-a209bf3c141f] (1.1ms) SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1 [["user_id", 102]]
2018-02-10T08:36:31.950350+00:00 app[web.1]: I, [2018-02-10T08:36:31.950278 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered shared/_user_info.html.erb (3.3ms)
2018-02-10T08:36:31.951116+00:00 app[web.1]: I, [2018-02-10T08:36:31.951041 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered shared/_error_messages.html.erb (0.1ms)
2018-02-10T08:36:31.952187+00:00 app[web.1]: I, [2018-02-10T08:36:31.952115 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered shared/_micropost_form.html.erb (1.6ms)
2018-02-10T08:36:31.953408+00:00 app[web.1]: D, [2018-02-10T08:36:31.953327 #9] DEBUG -- : [009217a0-f248-4911-af84-a209bf3c141f] CACHE (0.0ms) SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1 [["user_id", 102]]
2018-02-10T08:36:31.953621+00:00 app[web.1]: I, [2018-02-10T08:36:31.953544 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered shared/_feed.html.erb (1.2ms)
2018-02-10T08:36:31.953780+00:00 app[web.1]: I, [2018-02-10T08:36:31.953713 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered static_pages/_if_log_in_part.html.erb (6.9ms)
2018-02-10T08:36:31.953960+00:00 app[web.1]: I, [2018-02-10T08:36:31.953891 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered static_pages/home.html.erb within layouts/application (7.2ms)
2018-02-10T08:36:31.954888+00:00 app[web.1]: I, [2018-02-10T08:36:31.954818 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered layouts/_rails_default.html.erb (0.6ms)
2018-02-10T08:36:31.955217+00:00 app[web.1]: I, [2018-02-10T08:36:31.955145 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered layouts/_shim.html.erb (0.1ms)
2018-02-10T08:36:31.956486+00:00 app[web.1]: I, [2018-02-10T08:36:31.956415 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered layouts/_header.html.erb (1.0ms)
2018-02-10T08:36:31.957050+00:00 app[web.1]: I, [2018-02-10T08:36:31.956978 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Rendered layouts/_footer.html.erb (0.2ms)
2018-02-10T08:36:31.957417+00:00 app[web.1]: I, [2018-02-10T08:36:31.957348 #9] INFO -- : [009217a0-f248-4911-af84-a209bf3c141f] Completed 200 OK in 18ms (Views: 10.2ms | ActiveRecord: 1.9ms)
2018-02-10T08:36:46.618182+00:00 heroku[router]: at=info method=POST path="/microposts" host=sample-app-180103.herokuapp.com request_id=7c09f6c8-adf5-4eea-b5b3-6f8d216881c5 fwd="54.167.204.162" dyno=web.1 connect=0ms service=16ms status=302 bytes=1013 protocol=https
2018-02-10T08:36:46.604722+00:00 app[web.1]: I, [2018-02-10T08:36:46.604619 #9] INFO -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] Started POST "/microposts" for 54.167.204.162 at 2018-02-10 08:36:46 +0000
2018-02-10T08:36:46.605647+00:00 app[web.1]: I, [2018-02-10T08:36:46.605579 #9] INFO -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] Processing by MicropostsController#create as HTML
2018-02-10T08:36:46.605722+00:00 app[web.1]: I, [2018-02-10T08:36:46.605666 #9] INFO -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] Parameters: {"utf8"=>"✓", "authenticity_token"=>"AwAgHK6pMXVPbSV3hzo0j3g3vMcIIFZm9GnqNhCJrj/0Q7prGGu6DKnA596R+ho2Kr63fbV1lWk4ICsYsuknVQ==", "micropost"=>{"content"=>"of course i still love you"}, "commit"=>"Post"}
2018-02-10T08:36:46.608473+00:00 app[web.1]: D, [2018-02-10T08:36:46.608388 #9] DEBUG -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 102], ["LIMIT", 1]]
2018-02-10T08:36:46.611254+00:00 app[web.1]: D, [2018-02-10T08:36:46.611172 #9] DEBUG -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] (0.6ms) BEGIN
2018-02-10T08:36:46.613707+00:00 app[web.1]: D, [2018-02-10T08:36:46.613615 #9] DEBUG -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] SQL (1.1ms) INSERT INTO "microposts" ("content", "user_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["content", "of course i still love you"], ["user_id", 102], ["created_at", "2018-02-10 08:36:46.611756"], ["updated_at", "2018-02-10 08:36:46.611756"]]
2018-02-10T08:36:46.616573+00:00 app[web.1]: I, [2018-02-10T08:36:46.616506 #9] INFO -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] Redirected to https://sample-app-180103.herokuapp.com/
2018-02-10T08:36:46.615918+00:00 app[web.1]: D, [2018-02-10T08:36:46.615834 #9] DEBUG -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] (1.7ms) COMMIT
2018-02-10T08:36:46.616762+00:00 app[web.1]: I, [2018-02-10T08:36:46.616707 #9] INFO -- : [7c09f6c8-adf5-4eea-b5b3-6f8d216881c5] Completed 302 Found in 11ms (ActiveRecord: 4.4ms)
2018-02-10T08:36:46.921554+00:00 heroku[router]: at=info method=GET path="/" host=sample-app-180103.herokuapp.com request_id=0932fa0b-118d-42f6-9881-36f6b39aeaf7 fwd="54.167.204.162" dyno=web.1 connect=0ms service=20ms status=200 bytes=5069 protocol=https
2018-02-10T08:36:46.902498+00:00 app[web.1]: I, [2018-02-10T08:36:46.902382 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Started GET "/" for 54.167.204.162 at 2018-02-10 08:36:46 +0000
2018-02-10T08:36:46.903311+00:00 app[web.1]: I, [2018-02-10T08:36:46.903242 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Processing by StaticPagesController#home as HTML
2018-02-10T08:36:46.905639+00:00 app[web.1]: D, [2018-02-10T08:36:46.905564 #9] DEBUG -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 102], ["LIMIT", 1]]
2018-02-10T08:36:46.908255+00:00 app[web.1]: I, [2018-02-10T08:36:46.908185 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendering static_pages/home.html.erb within layouts/application
2018-02-10T08:36:46.910570+00:00 app[web.1]: D, [2018-02-10T08:36:46.910504 #9] DEBUG -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] (0.8ms) SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1 [["user_id", 102]]
2018-02-10T08:36:46.910737+00:00 app[web.1]: I, [2018-02-10T08:36:46.910681 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered shared/_user_info.html.erb (2.2ms)
2018-02-10T08:36:46.911178+00:00 app[web.1]: I, [2018-02-10T08:36:46.911112 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered shared/_error_messages.html.erb (0.0ms)
2018-02-10T08:36:46.911757+00:00 app[web.1]: I, [2018-02-10T08:36:46.911695 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered shared/_micropost_form.html.erb (0.9ms)
2018-02-10T08:36:46.912332+00:00 app[web.1]: D, [2018-02-10T08:36:46.912270 #9] DEBUG -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] CACHE (0.0ms) SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1 [["user_id", 102]]
2018-02-10T08:36:46.913732+00:00 app[web.1]: D, [2018-02-10T08:36:46.913641 #9] DEBUG -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Micropost Load (0.9ms) SELECT "microposts".* FROM "microposts" WHERE "microposts"."user_id" = $1 ORDER BY "microposts"."created_at" DESC LIMIT $2 OFFSET $3 [["user_id", 102], ["LIMIT", 30], ["OFFSET", 0]]
2018-02-10T08:36:46.915715+00:00 app[web.1]: I, [2018-02-10T08:36:46.915624 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered collection of microposts/_micropost.html.erb [1 times] (1.2ms)
2018-02-10T08:36:46.915960+00:00 app[web.1]: I, [2018-02-10T08:36:46.915870 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered shared/_feed.html.erb (4.0ms)
2018-02-10T08:36:46.916114+00:00 app[web.1]: I, [2018-02-10T08:36:46.916022 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered static_pages/_if_log_in_part.html.erb (7.6ms)
2018-02-10T08:36:46.916280+00:00 app[web.1]: I, [2018-02-10T08:36:46.916191 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered static_pages/home.html.erb within layouts/application (7.9ms)
2018-02-10T08:36:46.917358+00:00 app[web.1]: I, [2018-02-10T08:36:46.917259 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered layouts/_rails_default.html.erb (0.8ms)
2018-02-10T08:36:46.917660+00:00 app[web.1]: I, [2018-02-10T08:36:46.917563 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered layouts/_shim.html.erb (0.1ms)
2018-02-10T08:36:46.918666+00:00 app[web.1]: I, [2018-02-10T08:36:46.918574 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered layouts/_header.html.erb (0.8ms)
2018-02-10T08:36:46.919234+00:00 app[web.1]: I, [2018-02-10T08:36:46.919154 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Rendered layouts/_footer.html.erb (0.2ms)
2018-02-10T08:36:46.919622+00:00 app[web.1]: I, [2018-02-10T08:36:46.919542 #9] INFO -- : [0932fa0b-118d-42f6-9881-36f6b39aeaf7] Completed 200 OK in 16ms (Views: 9.8ms | ActiveRecord: 2.4ms)
2018-02-10T08:37:11.963508+00:00 app[web.1]: I, [2018-02-10T08:37:11.963419 #6] INFO -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] Started POST "/microposts" for 54.167.204.162 at 2018-02-10 08:37:11 +0000
2018-02-10T08:37:11.964318+00:00 app[web.1]: I, [2018-02-10T08:37:11.964241 #6] INFO -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] Processing by MicropostsController#create as HTML
2018-02-10T08:37:11.964441+00:00 app[web.1]: I, [2018-02-10T08:37:11.964385 #6] INFO -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] Parameters: {"utf8"=>"✓", "authenticity_token"=>"9YyRLcM48eTWRRR34jv8wg86TDBDoczMYUpOWpR1XhICzwtadfp6nTDo1t70+9J7XbNHiv70D8OtA490NhXXeA==", "micropost"=>{"content"=>"of course i still love you ", "picture"=>#<ActionDispatch::Http::UploadedFile:0x000000059de310 @tempfile=#<Tempfile:/tmp/RackMultipart20180210-6-5raez6.png>, @original_filename="of_course_i_still_love_you.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"micropost[picture]\"; filename=\"of_course_i_still_love_you.png\"\r\nContent-Type: image/png\r\n">}, "commit"=>"Post"}
2018-02-10T08:37:11.967134+00:00 app[web.1]: D, [2018-02-10T08:37:11.967035 #6] DEBUG -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 102], ["LIMIT", 1]]
2018-02-10T08:37:12.108048+00:00 app[web.1]: D, [2018-02-10T08:37:12.107937 #6] DEBUG -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] (0.8ms) BEGIN
2018-02-10T08:37:12.111060+00:00 app[web.1]: D, [2018-02-10T08:37:12.110966 #6] DEBUG -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] SQL (1.1ms) INSERT INTO "microposts" ("content", "user_id", "created_at", "updated_at", "picture") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["content", "of course i still love you "], ["user_id", 102], ["created_at", "2018-02-10 08:37:12.109064"], ["updated_at", "2018-02-10 08:37:12.109064"], ["picture", "of_course_i_still_love_you.png"]]
2018-02-10T08:37:15.043553+00:00 heroku[router]: at=info method=POST path="/microposts" host=sample-app-180103.herokuapp.com request_id=78b31c3c-e095-45c5-aa67-ea5fcc35f029 fwd="54.167.204.162" dyno=web.1 connect=1ms service=5913ms status=500 bytes=1891 protocol=https
2018-02-10T08:37:15.041675+00:00 app[web.1]: I, [2018-02-10T08:37:15.041608 #6] INFO -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] Completed 500 Internal Server Error in 3077ms (ActiveRecord: 3.5ms)
2018-02-10T08:37:15.041183+00:00 app[web.1]: D, [2018-02-10T08:37:15.041059 #6] DEBUG -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] (0.9ms) ROLLBACK
2018-02-10T08:37:15.042449+00:00 app[web.1]: F, [2018-02-10T08:37:15.042386 #6] FATAL -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029]
2018-02-10T08:37:15.042575+00:00 app[web.1]: :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2'</Message><Region>us-west-2</Region><RequestId>887F68335D42F1AF</RequestId><HostId>SyC39MW8piA8UwmHaUalcPWlOodGiA+dRHM4P8G9uMqmruTQDyhbzuZ/1gUkllhmVk1jX3+Iafc=</HostId></Error>"
2018-02-10T08:37:15.042555+00:00 app[web.1]: excon.error.response
2018-02-10T08:37:15.042553+00:00 app[web.1]: F, [2018-02-10T08:37:15.042492 #6] FATAL -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] Excon::Error::BadRequest (Expected(200) <=> Actual(400 Bad Request)
2018-02-10T08:37:15.042580+00:00 app[web.1]: :headers => {
2018-02-10T08:37:15.042577+00:00 app[web.1]: :cookies => [
2018-02-10T08:37:15.042579+00:00 app[web.1]: ]
2018-02-10T08:37:15.042581+00:00 app[web.1]: "Connection" => "close"
2018-02-10T08:37:15.042585+00:00 app[web.1]: "Server" => "AmazonS3"
2018-02-10T08:37:15.042584+00:00 app[web.1]: "Date" => "Sat, 10 Feb 2018 08:37:14 GMT"
2018-02-10T08:37:15.042587+00:00 app[web.1]: "x-amz-id-2" => "SyC39MW8piA8UwmHaUalcPWlOodGiA+dRHM4P8G9uMqmruTQDyhbzuZ/1gUkllhmVk1jX3+Iafc="
2018-02-10T08:37:15.042589+00:00 app[web.1]: }
2018-02-10T08:37:15.042591+00:00 app[web.1]: :host => "users-picture.s3.amazonaws.com"
2018-02-10T08:37:15.042592+00:00 app[web.1]: :local_address => "172.17.86.206"
2018-02-10T08:37:15.042583+00:00 app[web.1]: "Content-Type" => "application/xml"
2018-02-10T08:37:15.042588+00:00 app[web.1]: "x-amz-request-id" => "887F68335D42F1AF"
2018-02-10T08:37:15.042595+00:00 app[web.1]: :path => "/uploads/micropost/picture/19/of_course_i_still_love_you.png"
2018-02-10T08:37:15.042597+00:00 app[web.1]: :reason_phrase => "Bad Request"
2018-02-10T08:37:15.042593+00:00 app[web.1]: :local_port => 38558
2018-02-10T08:37:15.042599+00:00 app[web.1]: :status => 400
2018-02-10T08:37:15.042596+00:00 app[web.1]: :port => 443
2018-02-10T08:37:15.042605+00:00 app[web.1]: F, [2018-02-10T08:37:15.042546 #6] FATAL -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029]
2018-02-10T08:37:15.042600+00:00 app[web.1]: :status_line => "HTTP/1.1 400 Bad Request\r\n"
2018-02-10T08:37:15.042628+00:00 app[web.1]: F, [2018-02-10T08:37:15.042588 #6] FATAL -- : [78b31c3c-e095-45c5-aa67-ea5fcc35f029] app/controllers/microposts_controller.rb:11:in `create'
2018-02-10T08:37:15.042598+00:00 app[web.1]: :remote_ip => "52.218.208.146"
2018-02-10T08:37:15.042601+00:00 app[web.1]: ):
报错出现的条件:
仅在创建一个含有图片的微博的时候报错,若只是创建一个纯文字微博就不会报错