新手问题 学习 ruby on rails tutorial ,无法使用 aws 在生产环境中上传图片

Mind · 2018年02月10日 · 最后由 Mind 回复于 2018年02月10日 · 1139 次阅读

求前辈帮忙🙏

按照 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]: ):

报错出现的条件:

仅在创建一个含有图片的微博的时候报错,若只是创建一个纯文字微博就不会报错

The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2'
Garrus 回复

我的 bucket 的确是设置在'us-west-2'的,这个是怎么修改啊?

config.fog_credentials = {
····
  region:                 'us-west-2'
····
}
Garrus 回复

我重新换了一个 region 在'us-east-1'的 bucket,然后没有你给我看的报错了. 好像是这个桶的 request params 是'us-east-1',但是 region 确实'us-west-2'

Garrus 回复

但是还是不能上传图片 ,logs 里有其他的报错

Garrus 回复
2018-02-10T09:38:14.401556+00:00 app[web.1]: I, [2018-02-10T09:38:14.401494 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f] Started GET "/login" for 54.167.204.162 at 2018-02-10 09:38:14 +0000
2018-02-10T09:38:14.403252+00:00 app[web.1]: I, [2018-02-10T09:38:14.403187 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f] Processing by SessionsController#new as HTML
2018-02-10T09:38:14.404193+00:00 app[web.1]: D, [2018-02-10T09:38:14.404108 #6] DEBUG -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   User Load (1.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 102], ["LIMIT", 1]]
2018-02-10T09:38:14.405005+00:00 app[web.1]: I, [2018-02-10T09:38:14.404945 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f]   Rendering sessions/new.html.erb within layouts/application
2018-02-10T09:38:14.407439+00:00 app[web.1]: I, [2018-02-10T09:38:14.407370 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f]   Rendered sessions/new.html.erb within layouts/application (2.3ms)
2018-02-10T09:38:14.408112+00:00 app[web.1]: I, [2018-02-10T09:38:14.408057 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f]   Rendered layouts/_rails_default.html.erb (0.5ms)
2018-02-10T09:38:14.408300+00:00 app[web.1]: I, [2018-02-10T09:38:14.408239 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f]   Rendered layouts/_shim.html.erb (0.0ms)
2018-02-10T09:38:14.411868+00:00 app[web.1]: I, [2018-02-10T09:38:14.411813 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f]   Rendered layouts/_header.html.erb (3.4ms)
2018-02-10T09:38:14.411199+00:00 app[web.1]: D, [2018-02-10T09:38:14.411132 #10] DEBUG -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f]   User Load (1.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 102], ["LIMIT", 1]]
2018-02-10T09:38:14.411924+00:00 app[web.1]: I, [2018-02-10T09:38:14.411843 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendering static_pages/home.html.erb within layouts/application
2018-02-10T09:38:14.412216+00:00 app[web.1]: I, [2018-02-10T09:38:14.412155 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f]   Rendered layouts/_footer.html.erb (0.1ms)
2018-02-10T09:38:14.412483+00:00 app[web.1]: I, [2018-02-10T09:38:14.412430 #10]  INFO -- : [2f609cf1-4371-499c-a1e4-e0e2481f677f] Completed 200 OK in 9ms (Views: 7.1ms | ActiveRecord: 1.1ms)
2018-02-10T09:38:14.420990+00:00 app[web.1]: D, [2018-02-10T09:38:14.420918 #6] DEBUG -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]    (1.5ms)  SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1  [["user_id", 102]]
2018-02-10T09:38:14.421209+00:00 app[web.1]: I, [2018-02-10T09:38:14.421154 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered shared/_user_info.html.erb (6.0ms)
2018-02-10T09:38:14.424588+00:00 app[web.1]: I, [2018-02-10T09:38:14.424507 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered shared/_error_messages.html.erb (0.7ms)
2018-02-10T09:38:14.428658+00:00 app[web.1]: D, [2018-02-10T09:38:14.428578 #6] DEBUG -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   CACHE  (0.0ms)  SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1  [["user_id", 102]]
2018-02-10T09:38:14.426593+00:00 app[web.1]: I, [2018-02-10T09:38:14.426502 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered shared/_micropost_form.html.erb (4.8ms)
2018-02-10T09:38:14.432093+00:00 app[web.1]: D, [2018-02-10T09:38:14.432029 #6] DEBUG -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Micropost Load (2.0ms)  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-10T09:38:14.970535+00:00 heroku[router]: at=info method=GET path="/" host=sample-app-180103.herokuapp.com request_id=eba8a904-362a-4067-9dde-6b3e8849c50c fwd="54.167.204.162" dyno=web.1 connect=0ms service=572ms status=200 bytes=4997 protocol=https
2018-02-10T09:38:14.958969+00:00 app[web.1]: I, [2018-02-10T09:38:14.958850 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered collection of microposts/_micropost.html.erb [1 times] (525.7ms)
2018-02-10T09:38:14.959114+00:00 app[web.1]: I, [2018-02-10T09:38:14.959050 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered shared/_feed.html.erb (531.8ms)
2018-02-10T09:38:14.959210+00:00 app[web.1]: I, [2018-02-10T09:38:14.959149 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered static_pages/_if_log_in_part.html.erb (545.3ms)
2018-02-10T09:38:14.959316+00:00 app[web.1]: I, [2018-02-10T09:38:14.959256 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered static_pages/home.html.erb within layouts/application (547.3ms)
2018-02-10T09:38:14.962328+00:00 app[web.1]: I, [2018-02-10T09:38:14.962247 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered layouts/_rails_default.html.erb (1.7ms)
2018-02-10T09:38:14.965273+00:00 app[web.1]: I, [2018-02-10T09:38:14.965206 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered layouts/_header.html.erb (1.4ms)
2018-02-10T09:38:14.966546+00:00 app[web.1]: I, [2018-02-10T09:38:14.966395 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered layouts/_footer.html.erb (0.4ms)
2018-02-10T09:38:14.967115+00:00 app[web.1]: I, [2018-02-10T09:38:14.967051 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c] Completed 200 OK in 567ms (Views: 554.2ms | ActiveRecord: 4.7ms)
2018-02-10T09:38:14.963354+00:00 app[web.1]: I, [2018-02-10T09:38:14.963287 #6]  INFO -- : [eba8a904-362a-4067-9dde-6b3e8849c50c]   Rendered layouts/_shim.html.erb (0.3ms)
2018-02-10T09:38:45.621337+00:00 app[web.1]: I, [2018-02-10T09:38:45.621256 #6]  INFO -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff] Started POST "/microposts" for 54.167.204.162 at 2018-02-10 09:38:45 +0000
2018-02-10T09:38:45.695285+00:00 app[web.1]: D, [2018-02-10T09:38:45.695186 #6] DEBUG -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff]    (1.0ms)  BEGIN
2018-02-10T09:38:45.830740+00:00 app[web.1]: F, [2018-02-10T09:38:45.830678 #6] FATAL -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff]
2018-02-10T09:38:45.622398+00:00 app[web.1]: I, [2018-02-10T09:38:45.622332 #6]  INFO -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff] Processing by MicropostsController#create as HTML
2018-02-10T09:38:45.622572+00:00 app[web.1]: I, [2018-02-10T09:38:45.622514 #6]  INFO -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"Iu4pW8nXp4PSw2KRtACLa5jr0dZRTiNZRaqcdysz9FhvhbyjJ9sETWDxeithKRwvN8No31ymg0y76aOFUpYWUw==", "micropost"=>{"content"=>"of course i still love you", "picture"=>#<ActionDispatch::Http::UploadedFile:0x00000004c71970 @tempfile=#<Tempfile:/tmp/RackMultipart20180210-6-3a0coe.jpg>, @original_filename="念念不忘,必有回响.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"micropost[picture]\"; filename=\"\xE5\xBF\xB5\xE5\xBF\xB5\xE4\xB8\x8D\xE5\xBF\x98\xEF\xBC\x8C\xE5\xBF\x85\xE6\x9C\x89\xE5\x9B\x9E\xE5\x93\x8D.jpg\"\r\nContent-Type: image/jpeg\r\n">}, "commit"=>"Post"}
2018-02-10T09:38:45.830814+00:00 app[web.1]: F, [2018-02-10T09:38:45.830752 #6] FATAL -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff] Excon::Error::Forbidden (Expected(200) <=> Actual(403 Forbidden)
2018-02-10T09:38:45.626087+00:00 app[web.1]: D, [2018-02-10T09:38:45.626011 #6] DEBUG -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff]   User Load (1.4ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 102], ["LIMIT", 1]]
2018-02-10T09:38:45.830816+00:00 app[web.1]: excon.error.response
2018-02-10T09:38:45.830826+00:00 app[web.1]:   :cookies       => [
2018-02-10T09:38:45.830829+00:00 app[web.1]:   :headers       => {
2018-02-10T09:38:45.830830+00:00 app[web.1]:     "Connection"       => "close"
2018-02-10T09:38:45.830834+00:00 app[web.1]:     "Date"             => "Sat, 10 Feb 2018 09:38:44 GMT"
2018-02-10T09:38:45.830825+00:00 app[web.1]:   :body          => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><AWSAccessKeyId>AKIAJPR2IKMREBCSC7UQ</AWSAccessKeyId><StringToSign>AWS4-HMAC-SHA256\n20180210T093845Z\n20180210/us-east-1/s3/aws4_request\n2cd43adb534b8dff001baa3e209e9f445c7953925b0aac835ff42031b7fa656d</StringToSign><SignatureProvided>98c8939f7faa10c7ccb043b17c6a416ae3deac4f18dbc5be950a0c0590d42458</SignatureProvided><StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 38 30 32 31 30 54 30 39 33 38 34 35 5a 0a 32 30 31 38 30 32 31 30 2f 75 73 2d 65 61 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 32 63 64 34 33 61 64 62 35 33 34 62 38 64 66 66 30 30 31 62 61 61 33 65 32 30 39 65 39 66 34 34 35 63 37 39 35 33 39 32 35 62 30 61 61 63 38 33 35 66 66 34 32 30 33 31 62 37 66 61 36 35 36 64</StringToSignBytes><CanonicalRequest>PUT\n/uploads/micropost/picture/23/%E5%BF%B5%E5%BF%B5%E4%B8%8D%E5%BF%98_%E5%BF%85%E6%9C%89%E5%9B%9E%E5%93%8D.jpg\n\ncontent-length:9174\ncontent-type:image/jpeg\nhost:myuser-pictures.s3.amazonaws.com\nx-amz-acl:public-read\nx-amz-content-sha256:a0c138349c124e7dc479b8de77702ba86101b255d74b5e8f85d57d10c90199a4\nx-amz-date:20180210T093845Z\n\ncontent-length;content-type;host;x-amz-acl;x-amz-content-sha256;x-amz-date\na0c138349c124e7dc479b8de77702ba86101b255d74b5e8f85d57d10c90199a4</CanonicalRequest><CanonicalRequestBytes>50 55 54 0a 2f 75 70 6c 6f 61 64 73 2f 6d 69 63 72 6f 70 6f 73 74 2f 70 69 63 74 75 72 65 2f 32 33 2f 25 45 35 25 42 46 25 42 35 25 45 35 25 42 46 25 42 35 25 45 34 25 42 38 25 38 44 25 45 35 25 42 46 25 39 38 5f 25 45 35 25 42 46 25 38 35 25 45 36 25 39 43 25 38 39 25 45 35 25 39 42 25 39 45 25 45 35 25 39 33 25 38 44 2e 6a 70 67 0a 0a 63 6f 6e 74 65 6e 74 2d 6c 65 6e 67 74 68 3a 39 31 37 34 0a 63 6f 6e 74 65 6e 74 2d 74 79 70 65 3a 69 6d 61 67 65 2f 6a 70 65 67 0a 68 6f 73 74 3a 6d 79 75 73 65 72 2d 70 69 63 74 75 72 65 73 2e 73 33 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 0a 78 2d 61 6d 7a 2d 61 63 6c 3a 70 75 62 6c 69 63 2d 72 65 61 64 0a 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3a 61 30 63 31 33 38 33 34 39 63 31 32 34 65 37 64 63 34 37 39 62 38 64 65 37 37 37 30 32 62 61 38 36 31 30 31 62 32 35 35 64 37 34 62 35 65 38 66 38 35 64 35 37 64 31 30 63 39 30 31 39 39 61 34 0a 78 2d 61 6d 7a 2d 64 61 74 65 3a 32 30 31 38 30 32 31 30 54 30 39 33 38 34 35 5a 0a 0a 63 6f 6e 74 65 6e 74 2d 6c 65 6e 67 74 68 3b 63 6f 6e 74 65 6e 74 2d 74 79 70 65 3b 68 6f 73 74 3b 78 2d 61 6d 7a 2d 61 63 6c 3b 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3b 78 2d 61 6d 7a 2d 64 61 74 65 0a 61 30 63 31 33 38 33 34 39 63 31 32 34 65 37 64 63 34 37 39 62 38 64 65 37 37 37 30 32 62 61 38 36 31 30 31 62 32 35 35 64 37 34 62 35 65 38 66 38 35 64 35 37 64 31 30 63 39 30 31 39 39 61 34</CanonicalRequestBytes><RequestId>106929E9D39C9AD7</RequestId><HostId>YOuERmMaLT/DgoB0FBaVdAKKTSeFo9+EhR78RsjK7U6+k4bWJmr8cm+2zPdPXqepom81r68tnpI=</HostId></Error>"
2018-02-10T09:38:45.830828+00:00 app[web.1]:   ]
2018-02-10T09:38:45.698368+00:00 app[web.1]: D, [2018-02-10T09:38:45.698301 #6] DEBUG -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff]   SQL (1.3ms)  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 09:38:45.696288"], ["updated_at", "2018-02-10 09:38:45.696288"], ["picture", "念念不忘_必有回响.jpg"]]
2018-02-10T09:38:45.829162+00:00 app[web.1]: D, [2018-02-10T09:38:45.828994 #6] DEBUG -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff]    (1.1ms)  ROLLBACK
2018-02-10T09:38:45.830832+00:00 app[web.1]:     "Content-Type"     => "application/xml"
2018-02-10T09:38:45.830836+00:00 app[web.1]:     "x-amz-id-2"       => "YOuERmMaLT/DgoB0FBaVdAKKTSeFo9+EhR78RsjK7U6+k4bWJmr8cm+2zPdPXqepom81r68tnpI="
2018-02-10T09:38:45.830840+00:00 app[web.1]:   :host          => "myuser-pictures.s3.amazonaws.com"
2018-02-10T09:38:45.829579+00:00 app[web.1]: I, [2018-02-10T09:38:45.829507 #6]  INFO -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff] Completed 500 Internal Server Error in 207ms (ActiveRecord: 4.8ms)
2018-02-10T09:38:45.830844+00:00 app[web.1]:   :path          => "/uploads/micropost/picture/23/%E5%BF%B5%E5%BF%B5%E4%B8%8D%E5%BF%98_%E5%BF%85%E6%9C%89%E5%9B%9E%E5%93%8D.jpg"
2018-02-10T09:38:45.830851+00:00 app[web.1]: ):
2018-02-10T09:38:45.830845+00:00 app[web.1]:   :port          => 443
2018-02-10T09:38:45.830848+00:00 app[web.1]:   :status        => 403
2018-02-10T09:38:45.830841+00:00 app[web.1]:   :local_address => "172.18.144.14"
2018-02-10T09:38:45.830842+00:00 app[web.1]:   :local_port    => 58624
2018-02-10T09:38:45.830846+00:00 app[web.1]:   :reason_phrase => "Forbidden"
2018-02-10T09:38:45.830849+00:00 app[web.1]:   :status_line   => "HTTP/1.1 403 Forbidden\r\n"
2018-02-10T09:38:45.830959+00:00 app[web.1]: F, [2018-02-10T09:38:45.830915 #6] FATAL -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff] app/controllers/microposts_controller.rb:11:in `create'
2018-02-10T09:38:45.830835+00:00 app[web.1]:     "Server"           => "AmazonS3"
2018-02-10T09:38:45.830838+00:00 app[web.1]:     "x-amz-request-id" => "106929E9D39C9AD7"
2018-02-10T09:38:45.830839+00:00 app[web.1]:   }
2018-02-10T09:38:45.830905+00:00 app[web.1]: F, [2018-02-10T09:38:45.830817 #6] FATAL -- : [9dd9fd24-f596-4757-80cf-8cb0d123e8ff]
2018-02-10T09:38:45.830847+00:00 app[web.1]:   :remote_ip     => "54.231.120.163"
2018-02-10T09:38:45.832959+00:00 heroku[router]: at=info method=POST path="/microposts" host=sample-app-180103.herokuapp.com request_id=9dd9fd24-f596-4757-80cf-8cb0d123e8ff fwd="54.167.204.162" dyno=web.1 connect=0ms service=4111ms status=500 bytes=1891 protocol=https
2018-02-10T09:48:31.471012+00:00 heroku[router]: at=info method=GET path="/" host=sample-app-180103.herokuapp.com request_id=68ce8e93-7fcc-486d-aa39-ffba97ae7467 fwd="54.167.204.162" dyno=web.1 connect=0ms service=20ms status=200 bytes=4997 protocol=https
2018-02-10T09:48:31.450222+00:00 app[web.1]: I, [2018-02-10T09:48:31.450120 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467] Started GET "/" for 54.167.204.162 at 2018-02-10 09:48:31 +0000
2018-02-10T09:48:31.451392+00:00 app[web.1]: I, [2018-02-10T09:48:31.451306 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467] Processing by StaticPagesController#home as HTML
2018-02-10T09:48:31.454357+00:00 app[web.1]: D, [2018-02-10T09:48:31.454279 #6] DEBUG -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   User Load (1.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 102], ["LIMIT", 1]]
2018-02-10T09:48:31.457829+00:00 app[web.1]: I, [2018-02-10T09:48:31.457750 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendering static_pages/home.html.erb within layouts/application
2018-02-10T09:48:31.460356+00:00 app[web.1]: D, [2018-02-10T09:48:31.460281 #6] DEBUG -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]    (1.1ms)  SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1  [["user_id", 102]]
2018-02-10T09:48:31.460542+00:00 app[web.1]: I, [2018-02-10T09:48:31.460473 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered shared/_user_info.html.erb (2.4ms)
2018-02-10T09:48:31.461002+00:00 app[web.1]: I, [2018-02-10T09:48:31.460933 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered shared/_error_messages.html.erb (0.0ms)
2018-02-10T09:48:31.461713+00:00 app[web.1]: I, [2018-02-10T09:48:31.461639 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered shared/_micropost_form.html.erb (1.0ms)
2018-02-10T09:48:31.462290+00:00 app[web.1]: D, [2018-02-10T09:48:31.462216 #6] DEBUG -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   CACHE  (0.0ms)  SELECT COUNT(*) FROM "microposts" WHERE "microposts"."user_id" = $1  [["user_id", 102]]
2018-02-10T09:48:31.463968+00:00 app[web.1]: D, [2018-02-10T09:48:31.463890 #6] DEBUG -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Micropost Load (1.1ms)  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-10T09:48:31.465086+00:00 app[web.1]: I, [2018-02-10T09:48:31.465013 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered collection of microposts/_micropost.html.erb [1 times] (0.7ms)
2018-02-10T09:48:31.465433+00:00 app[web.1]: I, [2018-02-10T09:48:31.465362 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered shared/_feed.html.erb (3.3ms)
2018-02-10T09:48:31.465543+00:00 app[web.1]: I, [2018-02-10T09:48:31.465477 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered static_pages/_if_log_in_part.html.erb (7.5ms)
2018-02-10T09:48:31.465663+00:00 app[web.1]: I, [2018-02-10T09:48:31.465597 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered static_pages/home.html.erb within layouts/application (7.7ms)
2018-02-10T09:48:31.466248+00:00 app[web.1]: I, [2018-02-10T09:48:31.466178 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered layouts/_rails_default.html.erb (0.4ms)
2018-02-10T09:48:31.466441+00:00 app[web.1]: I, [2018-02-10T09:48:31.466372 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered layouts/_shim.html.erb (0.0ms)
2018-02-10T09:48:31.467175+00:00 app[web.1]: I, [2018-02-10T09:48:31.467106 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered layouts/_header.html.erb (0.5ms)
2018-02-10T09:48:31.467481+00:00 app[web.1]: I, [2018-02-10T09:48:31.467413 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467]   Rendered layouts/_footer.html.erb (0.1ms)
2018-02-10T09:48:31.467720+00:00 app[web.1]: I, [2018-02-10T09:48:31.467652 #6]  INFO -- : [68ce8e93-7fcc-486d-aa39-ffba97ae7467] Completed 200 OK in 16ms (Views: 7.9ms | ActiveRecord: 3.3ms)
2018-02-10T09:48:42.057934+00:00 heroku[router]: at=info method=GET path="/" host=sample-app-180103.herokuapp.com request_id=9e95c9ea-3ece-4a11-becd-031ff25a48ca fwd="49.65.250.146" dyno=web.1 connect=1ms service=1ms status=301 bytes=163 protocol=http
2018-02-10T09:48:43.004865+00:00 heroku[router]: at=info method=GET path="/" host=sample-app-180103.herokuapp.com request_id=1433bdff-c388-458e-a636-d23b8d78e0f3 fwd="49.65.250.146" dyno=web.1 connect=1ms service=15ms status=200 bytes=2841 protocol=https
2018-02-10T09:48:42.988691+00:00 app[web.1]: I, [2018-02-10T09:48:42.988594 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3] Started GET "/" for 49.65.250.146 at 2018-02-10 09:48:42 +0000
2018-02-10T09:48:42.989419+00:00 app[web.1]: I, [2018-02-10T09:48:42.989346 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3] Processing by StaticPagesController#home as HTML
2018-02-10T09:48:42.993528+00:00 app[web.1]: I, [2018-02-10T09:48:42.993461 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   Rendering static_pages/home.html.erb within layouts/application
2018-02-10T09:48:42.997021+00:00 app[web.1]: D, [2018-02-10T09:48:42.996953 #6] DEBUG -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   User Load (1.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT $1  [["LIMIT", 1]]
2018-02-10T09:48:42.998656+00:00 app[web.1]: I, [2018-02-10T09:48:42.998593 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   Rendered static_pages/_if_log_out_part.html.erb (0.8ms)
2018-02-10T09:48:42.998893+00:00 app[web.1]: I, [2018-02-10T09:48:42.998835 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   Rendered static_pages/home.html.erb within layouts/application (5.3ms)
2018-02-10T09:48:42.999747+00:00 app[web.1]: I, [2018-02-10T09:48:42.999684 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   Rendered layouts/_rails_default.html.erb (0.4ms)
2018-02-10T09:48:42.999923+00:00 app[web.1]: I, [2018-02-10T09:48:42.999869 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   Rendered layouts/_shim.html.erb (0.0ms)
2018-02-10T09:48:43.000627+00:00 app[web.1]: D, [2018-02-10T09:48:43.000566 #6] DEBUG -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT $1  [["LIMIT", 1]]
2018-02-10T09:48:43.000826+00:00 app[web.1]: I, [2018-02-10T09:48:43.000770 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   Rendered layouts/_header.html.erb (0.7ms)
2018-02-10T09:48:43.001136+00:00 app[web.1]: I, [2018-02-10T09:48:43.001078 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3]   Rendered layouts/_footer.html.erb (0.1ms)
2018-02-10T09:48:43.001595+00:00 app[web.1]: I, [2018-02-10T09:48:43.001296 #6]  INFO -- : [1433bdff-c388-458e-a636-d23b8d78e0f3] Completed 200 OK in 12ms (Views: 6.7ms | ActiveRecord: 1.3ms)
2018-02-10T09:48:43.381745+00:00 heroku[router]: at=info method=GET path="/assets/application-30bba49027f3cb704192910ffbdb5f2e567bc29d091a86128f922104fbf13bf1.css" host=sample-app-180103.herokuapp.com request_id=df0ceea3-8d25-4d6e-aae6-62925bc10c5a fwd="49.65.250.146" dyno=web.1 connect=0ms service=2ms status=200 bytes=21197 protocol=https
2018-02-10T09:48:43.383274+00:00 heroku[router]: at=info method=GET path="/assets/application-ab447df98d0a8f179077b6934860dfcb7113a267fd726f9d9bd922d749f89f5d.js" host=sample-app-180103.herokuapp.com request_id=697aba6a-780b-4cf3-8f6a-007d1a4582aa fwd="49.65.250.146" dyno=web.1 connect=0ms service=4ms status=200 bytes=57004 protocol=https
2018-02-10T09:48:43.855437+00:00 heroku[router]: at=info method=GET path="/assets/rails-c094bc3a4bf50e5bb477109e5cb0d213af27ad75b481c4df249f50974dbeefe6.png" host=sample-app-180103.herokuapp.com request_id=c684c827-d1b0-4652-881e-fc7ee237f057 fwd="49.65.250.146" dyno=web.1 connect=1ms service=2ms status=200 bytes=13232 protocol=https
2018-02-10T09:48:44.246257+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=sample-app-180103.herokuapp.com request_id=3bf0727c-e0cc-4c05-b1c2-daaefffe71f5 fwd="49.65.250.146" dyno=web.1 connect=1ms service=1ms status=200 bytes=207 protocol=https
Garrus 回复

谢谢哈 问题解决了😂

Mind 关闭了讨论 02月10日 20:58
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册