2017-02-24 59 views
2

我試圖從基於Heroku服務器的Rails應用程序的聯繫人窗體發送電子郵件,並且出現錯誤消息:Heroku環境下的Ruby on Rails應用程序:「使用Mailgun發送電子郵件」錯誤

很抱歉,但出錯了。如果您是應用程序所有者,請查看日誌以獲取更多信息。

我的意圖是學習如何將郵件服務器服務集成到我的Heroku帳戶中。爲此,使用的插件是MailGun。我甚至用我的個人電子郵件創建了一個MailGun帳戶,以便能夠檢查我是否收到電子郵件。

從CLOUD9環境與成功的Heroku服務器上部署代碼後,我在Ruby代碼所做的唯一的變化是以下的東西:

到config/environment.rb

ActionMailer::Base.smtp_settings = { 
    :port   => ENV['MAILGUN_SMTP_PORT'], 
    :address  => ENV['MAILGUN_SMTP_SERVER'], 
    :user_name  => ENV['MAILGUN_SMTP_LOGIN'], 
    :password  => ENV['MAILGUN_SMTP_PASSWORD'], 
    :domain   => 'blahblahblah.herokuapp.com', 
    :authentication => :plain, 
} 
ActionMailer::Base.delivery_method = :smtp 

什麼問題?任何提示解決方案?

更新請求信息(Heroku的日誌 - 我不能因爲在StackOverflow的身體字符的限制,所有的日誌更新):

iamsamuel:~/workspace/saasapp (master) $ heroku logs 
2017-02-24T20:18:19.316716+00:00 app[web.1]: Content-Type: text/html; 
2017-02-24T20:18:19.316717+00:00 app[web.1]: charset=UTF-8 
2017-02-24T20:18:19.316718+00:00 app[web.1]: Content-Transfer-Encoding: 7bit 
2017-02-24T20:18:19.316718+00:00 app[web.1]: 
2017-02-24T20:18:19.316719+00:00 app[web.1]: <!DOCTYPE html> 
2017-02-24T20:18:19.316719+00:00 app[web.1]: <html> 
2017-02-24T20:18:19.316720+00:00 app[web.1]:  <head> 
2017-02-24T20:18:19.316721+00:00 app[web.1]:  </head> 
2017-02-24T20:18:19.316721+00:00 app[web.1]:  <body> 
2017-02-24T20:18:19.316722+00:00 app[web.1]:   <p> 
2017-02-24T20:18:19.316723+00:00 app[web.1]:    You have received a message from the site's contact form, from Sam, [email protected] 
2017-02-24T20:18:19.316724+00:00 app[web.1]:   </p> 
2017-02-24T20:18:19.316724+00:00 app[web.1]:   <p> 
2017-02-24T20:18:19.316725+00:00 app[web.1]: 
2017-02-24T20:18:19.316725+00:00 app[web.1]:   </p> 
2017-02-24T20:18:19.316726+00:00 app[web.1]:  </body> 
2017-02-24T20:18:19.316726+00:00 app[web.1]: </html> 
2017-02-24T20:18:19.316886+00:00 app[web.1]: I, [2017-02-24T20:18:19.316838 #4] INFO -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Completed 500 Internal Server Error in 1166ms (ActiveRecord: 4.1ms) 
2017-02-24T20:18:19.317316+00:00 app[web.1]: F, [2017-02-24T20:18:19.317273 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] 
2017-02-24T20:18:19.317357+00:00 app[web.1]: F, [2017-02-24T20:18:19.317318 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email. 
2017-02-24T20:18:19.317358+00:00 app[web.1]:): 
2017-02-24T20:18:19.317396+00:00 app[web.1]: F, [2017-02-24T20:18:19.317355 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] 
2017-02-24T20:18:19.317435+00:00 app[web.1]: F, [2017-02-24T20:18:19.317396 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] app/controllers/contacts_controller.rb:15:in `create' 
2017-02-24T20:18:19.520898+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=62153ff0-bef7-4e44-958b-447fb18e7c23 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:53:16.169251+00:00 heroku[web.1]: Idling 
2017-02-24T20:53:16.169901+00:00 heroku[web.1]: State changed from up to down 
2017-02-24T20:53:17.034264+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2017-02-24T20:53:17.078764+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish 
2017-02-24T20:53:17.078952+00:00 app[web.1]: === puma shutdown: 2017-02-24 20:53:17 +0000 === 
2017-02-24T20:53:17.078957+00:00 app[web.1]: - Goodbye! 
2017-02-24T20:53:17.079100+00:00 app[web.1]: Exiting 
2017-02-24T20:53:17.347515+00:00 heroku[web.1]: Process exited with status 0 
2017-02-24T20:57:24.680979+00:00 heroku[web.1]: Unidling 
2017-02-24T20:57:24.681258+00:00 heroku[web.1]: State changed from down to starting 
2017-02-24T20:57:27.221989+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 44473 -e production` 
2017-02-24T20:57:30.299354+00:00 app[web.1]: => Booting Puma 
2017-02-24T20:57:30.299447+00:00 app[web.1]: => Rails 5.0.0 application starting in production on http://0.0.0.0:44473 
2017-02-24T20:57:30.299502+00:00 app[web.1]: => Run `rails server -h` for more startup options 
2017-02-24T20:57:31.229688+00:00 app[web.1]: Puma starting in single mode... 
2017-02-24T20:57:31.229714+00:00 app[web.1]: * Min threads: 5, max threads: 5 
2017-02-24T20:57:31.229713+00:00 app[web.1]: * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl 
2017-02-24T20:57:31.229716+00:00 app[web.1]: * Environment: production 
2017-02-24T20:57:31.229813+00:00 app[web.1]: * Listening on tcp://0.0.0.0:44473 
2017-02-24T20:57:31.230029+00:00 app[web.1]: Use Ctrl-C to stop 
2017-02-24T20:57:31.421917+00:00 heroku[web.1]: State changed from starting to up 
2017-02-24T20:57:32.788592+00:00 heroku[router]: at=info method=GET path="/" host=infinite-forest-28304.herokuapp.com request_id=dedd394a-498a-464d-a669-ed19fa2fd418 fwd="188.83.235.112" dyno=web.1 connect=0ms service=58ms status=200 bytes=2753 
2017-02-24T20:57:32.737531+00:00 app[web.1]: I, [2017-02-24T20:57:32.737424 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Started GET "/" for 188.83.235.112 at 2017-02-24 20:57:32 +0000 
2017-02-24T20:57:32.740219+00:00 app[web.1]: I, [2017-02-24T20:57:32.740152 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Processing by PagesController#home as HTML 
2017-02-24T20:57:32.752357+00:00 app[web.1]: I, [2017-02-24T20:57:32.752273 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendering pages/home.html.erb within layouts/application 
2017-02-24T20:57:32.753153+00:00 app[web.1]: I, [2017-02-24T20:57:32.753082 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendered pages/home.html.erb within layouts/application (0.6ms) 
2017-02-24T20:57:32.759595+00:00 app[web.1]: I, [2017-02-24T20:57:32.759524 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Completed 200 OK in 19ms (Views: 8.6ms | ActiveRecord: 0.0ms) 
2017-02-24T20:57:32.929609+00:00 heroku[router]: at=info method=GET path="/assets/application-95163fa38446d1bb6139f870d5fb932af7fa47b347b8951923c32a4565386aa6.js" host=infinite-forest-28304.herokuapp.com request_id=80d55a95-cbe8-4982-a571-bc8850567a87 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:57:32.928158+00:00 heroku[router]: at=info method=GET path="/assets/application-5ed627eba0abe94ba4e2c255c2298f55d9bca9b4ea45ded59ba1705edc5385d0.css" host=infinite-forest-28304.herokuapp.com request_id=a9c456f3-e7cd-4d6a-865f-2c8f5efbdaa7 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:57:33.143930+00:00 heroku[router]: at=info method=GET path="/assets/font-awesome/fontawesome-webfont-2932abf996373e87fbf2e950876b1962f1b57db954a1643ea68831d9fbb74da4.woff2?v=4.6.2" host=infinite-forest-28304.herokuapp.com request_id=90d78563-eaa6-4f24-a054-5c89beada59c fwd="188.83.235.112" dyno=web.1 connect=3ms service=1ms status=304 bytes=48 
2017-02-24T20:57:33.402193+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=7c20311c-bd5a-46c3-a9d5-c6266c1f9331 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:57:50.706814+00:00 heroku[router]: at=info method=GET path="/contact-us" host=infinite-forest-28304.herokuapp.com request_id=0ec752b1-0d75-42dd-83f6-ecd127086bfb fwd="188.83.235.112" dyno=web.1 connect=0ms service=35ms status=200 bytes=4317 
2017-02-24T20:57:50.651067+00:00 app[web.1]: I, [2017-02-24T20:57:50.650984 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Started GET "/contact-us" for 188.83.235.112 at 2017-02-24 20:57:50 +0000 
2017-02-24T20:57:50.652579+00:00 app[web.1]: I, [2017-02-24T20:57:50.652518 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Processing by ContactsController#new as HTML 
2017-02-24T20:57:50.669618+00:00 app[web.1]: I, [2017-02-24T20:57:50.669536 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendering contacts/new.html.erb within layouts/application 
2017-02-24T20:57:50.681558+00:00 app[web.1]: I, [2017-02-24T20:57:50.681481 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendered contacts/new.html.erb within layouts/application (11.8ms) 
2017-02-24T20:57:50.682909+00:00 app[web.1]: I, [2017-02-24T20:57:50.682846 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Completed 200 OK in 30ms (Views: 14.0ms | ActiveRecord: 7.5ms) 
2017-02-24T20:59:14.426470+00:00 app[web.1]: I, [2017-02-24T20:59:14.426395 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Started POST "/contacts" for 188.83.235.112 at 2017-02-24 20:59:14 +0000 
2017-02-24T20:59:14.427281+00:00 app[web.1]: I, [2017-02-24T20:59:14.427232 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Processing by ContactsController#create as HTML 
2017-02-24T20:59:14.427366+00:00 app[web.1]: I, [2017-02-24T20:59:14.427324 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Parameters: {"utf8"=>"✓", "authenticity_token"=>"MgrtXM/8aUAYPnJ2ph4eIbsqMbLR/xXMZabcKmKh4myMlp0MdLJ2dCHnh7KshXSCqAsIzGQr0SdebpJw1v0QHw==", "contact"=>{"name"=>"Jesse Pinkman", "email"=>"[email protected]", "comments"=>"Yo Beach!"}, "commit"=>"Submit"} 
2017-02-24T20:59:14.429694+00:00 app[web.1]: D, [2017-02-24T20:59:14.429641 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (0.9ms) BEGIN 
2017-02-24T20:59:14.434537+00:00 app[web.1]: D, [2017-02-24T20:59:14.434485 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] SQL (1.3ms) INSERT INTO "contacts" ("name", "email", "comments", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Jesse Pinkman"], ["email", "[email protected]"], ["comments", "Yo Beach!"], ["created_at", 2017-02-24 20:59:14 UTC], ["updated_at", 2017-02-24 20:59:14 UTC]] 
2017-02-24T20:59:14.436712+00:00 app[web.1]: D, [2017-02-24T20:59:14.436665 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (1.9ms) COMMIT 
2017-02-24T20:59:14.441776+00:00 app[web.1]: I, [2017-02-24T20:59:14.441724 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendering contact_mailer/contact_email.html.erb 
2017-02-24T20:59:14.442284+00:00 app[web.1]: I, [2017-02-24T20:59:14.442237 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendered contact_mailer/contact_email.html.erb (0.4ms) 
2017-02-24T20:59:14.622612+00:00 app[web.1]: D, [2017-02-24T20:59:14.622518 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] ContactMailer#contact_email: processed outbound mail in 184.5ms 
2017-02-24T20:59:14.749027+00:00 heroku[router]: at=info method=POST path="/contacts" host=infinite-forest-28304.herokuapp.com request_id=606794a4-3f9b-417c-b3ca-72af4d8bafb6 fwd="188.83.235.112" dyno=web.1 connect=0ms service=304ms status=500 bytes=1669 
2017-02-24T20:59:14.722589+00:00 app[web.1]: I, [2017-02-24T20:59:14.722491 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Sent mail to [email protected] (99.8ms) 
2017-02-24T20:59:14.722632+00:00 app[web.1]: D, [2017-02-24T20:59:14.722588 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Date: Fri, 24 Feb 2017 20:59:14 +0000 
2017-02-24T20:59:14.722632+00:00 app[web.1]: From: [email protected] 
2017-02-24T20:59:14.722633+00:00 app[web.1]: To: [email protected] 
2017-02-24T20:59:14.722633+00:00 app[web.1]: Message-ID: <[email protected]47b44.mail> 
2017-02-24T20:59:14.722634+00:00 app[web.1]: Subject: Contact Form Message 
2017-02-24T20:59:14.722634+00:00 app[web.1]: Mime-Version: 1.0 
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Type: text/html; 
2017-02-24T20:59:14.722635+00:00 app[web.1]: charset=UTF-8 
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Transfer-Encoding: 7bit 
2017-02-24T20:59:14.722636+00:00 app[web.1]: 
2017-02-24T20:59:14.722636+00:00 app[web.1]: <!DOCTYPE html> 
2017-02-24T20:59:14.722637+00:00 app[web.1]: <html> 
2017-02-24T20:59:14.722637+00:00 app[web.1]:  <head> 
2017-02-24T20:59:14.722637+00:00 app[web.1]:  </head> 
2017-02-24T20:59:14.722638+00:00 app[web.1]:  <body> 
2017-02-24T20:59:14.722638+00:00 app[web.1]:   <p> 
2017-02-24T20:59:14.722638+00:00 app[web.1]:    You have received a message from the site's contact form, from Jesse Pinkman, [email protected] 
2017-02-24T20:59:14.722639+00:00 app[web.1]:   </p> 
2017-02-24T20:59:14.722639+00:00 app[web.1]:   <p> 
2017-02-24T20:59:14.722639+00:00 app[web.1]: 
2017-02-24T20:59:14.722640+00:00 app[web.1]:   </p> 
2017-02-24T20:59:14.722640+00:00 app[web.1]:  </body> 
2017-02-24T20:59:14.722640+00:00 app[web.1]: </html> 
2017-02-24T20:59:14.722825+00:00 app[web.1]: I, [2017-02-24T20:59:14.722779 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Completed 500 Internal Server Error in 295ms (ActiveRecord: 4.1ms) 
2017-02-24T20:59:14.723286+00:00 app[web.1]: F, [2017-02-24T20:59:14.723242 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] 
2017-02-24T20:59:14.723324+00:00 app[web.1]: F, [2017-02-24T20:59:14.723287 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email. 
2017-02-24T20:59:14.723325+00:00 app[web.1]:): 
2017-02-24T20:59:14.723357+00:00 app[web.1]: F, [2017-02-24T20:59:14.723324 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] 
2017-02-24T20:59:14.723390+00:00 app[web.1]: F, [2017-02-24T20:59:14.723357 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] app/controllers/contacts_controller.rb:15:in `create' 
iamsamuel:~/workspace/saasapp (master) $ clear 
iamsamuel:~/workspace/saasapp (master) $ clear 
iamsamuel:~/workspace/saasapp (master) $ heroku logs 
2017-02-24T20:18:19.316723+00:00 app[web.1]:    You have received a message from the site's contact form, from Sam, [email protected] 
2017-02-24T20:18:19.316724+00:00 app[web.1]:   </p> 
2017-02-24T20:18:19.316724+00:00 app[web.1]:   <p> 
2017-02-24T20:18:19.316725+00:00 app[web.1]:    
2017-02-24T20:18:19.316725+00:00 app[web.1]:   </p> 
2017-02-24T20:18:19.316726+00:00 app[web.1]:  </body> 
2017-02-24T20:18:19.316726+00:00 app[web.1]: </html> 
2017-02-24T20:18:19.316886+00:00 app[web.1]: I, [2017-02-24T20:18:19.316838 #4] INFO -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Completed 500 Internal Server Error in 1166ms (ActiveRecord: 4.1ms) 
2017-02-24T20:18:19.317316+00:00 app[web.1]: F, [2017-02-24T20:18:19.317273 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] 
2017-02-24T20:18:19.317357+00:00 app[web.1]: F, [2017-02-24T20:18:19.317318 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email. 
2017-02-24T20:18:19.317358+00:00 app[web.1]:): 
2017-02-24T20:18:19.317396+00:00 app[web.1]: F, [2017-02-24T20:18:19.317355 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] 
2017-02-24T20:18:19.317435+00:00 app[web.1]: F, [2017-02-24T20:18:19.317396 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] app/controllers/contacts_controller.rb:15:in `create' 
2017-02-24T20:18:19.520898+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=62153ff0-bef7-4e44-958b-447fb18e7c23 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:53:16.169251+00:00 heroku[web.1]: Idling 
2017-02-24T20:53:16.169901+00:00 heroku[web.1]: State changed from up to down 
2017-02-24T20:53:17.034264+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2017-02-24T20:53:17.078764+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish 
2017-02-24T20:53:17.078952+00:00 app[web.1]: === puma shutdown: 2017-02-24 20:53:17 +0000 === 
2017-02-24T20:53:17.078957+00:00 app[web.1]: - Goodbye! 
2017-02-24T20:53:17.079100+00:00 app[web.1]: Exiting 
2017-02-24T20:53:17.347515+00:00 heroku[web.1]: Process exited with status 0 
2017-02-24T20:57:24.680979+00:00 heroku[web.1]: Unidling 
2017-02-24T20:57:24.681258+00:00 heroku[web.1]: State changed from down to starting 
2017-02-24T20:57:27.221989+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 44473 -e production` 
2017-02-24T20:57:30.299354+00:00 app[web.1]: => Booting Puma 
2017-02-24T20:57:30.299447+00:00 app[web.1]: => Rails 5.0.0 application starting in production on http://0.0.0.0:44473 
2017-02-24T20:57:30.299502+00:00 app[web.1]: => Run `rails server -h` for more startup options 
2017-02-24T20:57:31.229688+00:00 app[web.1]: Puma starting in single mode... 
2017-02-24T20:57:31.229714+00:00 app[web.1]: * Min threads: 5, max threads: 5 
2017-02-24T20:57:31.229713+00:00 app[web.1]: * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl 
2017-02-24T20:57:31.229716+00:00 app[web.1]: * Environment: production 
2017-02-24T20:57:31.229813+00:00 app[web.1]: * Listening on tcp://0.0.0.0:44473 
2017-02-24T20:57:31.230029+00:00 app[web.1]: Use Ctrl-C to stop 
2017-02-24T20:57:31.421917+00:00 heroku[web.1]: State changed from starting to up 
2017-02-24T20:57:32.788592+00:00 heroku[router]: at=info method=GET path="/" host=infinite-forest-28304.herokuapp.com request_id=dedd394a-498a-464d-a669-ed19fa2fd418 fwd="188.83.235.112" dyno=web.1 connect=0ms service=58ms status=200 bytes=2753 
2017-02-24T20:57:32.737531+00:00 app[web.1]: I, [2017-02-24T20:57:32.737424 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Started GET "/" for 188.83.235.112 at 2017-02-24 20:57:32 +0000 
2017-02-24T20:57:32.740219+00:00 app[web.1]: I, [2017-02-24T20:57:32.740152 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Processing by PagesController#home as HTML 
2017-02-24T20:57:32.752357+00:00 app[web.1]: I, [2017-02-24T20:57:32.752273 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendering pages/home.html.erb within layouts/application 
2017-02-24T20:57:32.753153+00:00 app[web.1]: I, [2017-02-24T20:57:32.753082 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendered pages/home.html.erb within layouts/application (0.6ms) 
2017-02-24T20:57:32.759595+00:00 app[web.1]: I, [2017-02-24T20:57:32.759524 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Completed 200 OK in 19ms (Views: 8.6ms | ActiveRecord: 0.0ms) 
2017-02-24T20:57:32.929609+00:00 heroku[router]: at=info method=GET path="/assets/application-95163fa38446d1bb6139f870d5fb932af7fa47b347b8951923c32a4565386aa6.js" host=infinite-forest-28304.herokuapp.com request_id=80d55a95-cbe8-4982-a571-bc8850567a87 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:57:32.928158+00:00 heroku[router]: at=info method=GET path="/assets/application-5ed627eba0abe94ba4e2c255c2298f55d9bca9b4ea45ded59ba1705edc5385d0.css" host=infinite-forest-28304.herokuapp.com request_id=a9c456f3-e7cd-4d6a-865f-2c8f5efbdaa7 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:57:33.143930+00:00 heroku[router]: at=info method=GET path="/assets/font-awesome/fontawesome-webfont-2932abf996373e87fbf2e950876b1962f1b57db954a1643ea68831d9fbb74da4.woff2?v=4.6.2" host=infinite-forest-28304.herokuapp.com request_id=90d78563-eaa6-4f24-a054-5c89beada59c fwd="188.83.235.112" dyno=web.1 connect=3ms service=1ms status=304 bytes=48 
2017-02-24T20:57:33.402193+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=7c20311c-bd5a-46c3-a9d5-c6266c1f9331 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T20:57:50.706814+00:00 heroku[router]: at=info method=GET path="/contact-us" host=infinite-forest-28304.herokuapp.com request_id=0ec752b1-0d75-42dd-83f6-ecd127086bfb fwd="188.83.235.112" dyno=web.1 connect=0ms service=35ms status=200 bytes=4317 
2017-02-24T20:57:50.651067+00:00 app[web.1]: I, [2017-02-24T20:57:50.650984 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Started GET "/contact-us" for 188.83.235.112 at 2017-02-24 20:57:50 +0000 
2017-02-24T20:57:50.652579+00:00 app[web.1]: I, [2017-02-24T20:57:50.652518 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Processing by ContactsController#new as HTML 
2017-02-24T20:57:50.669618+00:00 app[web.1]: I, [2017-02-24T20:57:50.669536 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendering contacts/new.html.erb within layouts/application 
2017-02-24T20:57:50.681558+00:00 app[web.1]: I, [2017-02-24T20:57:50.681481 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendered contacts/new.html.erb within layouts/application (11.8ms) 
2017-02-24T20:57:50.682909+00:00 app[web.1]: I, [2017-02-24T20:57:50.682846 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Completed 200 OK in 30ms (Views: 14.0ms | ActiveRecord: 7.5ms) 
2017-02-24T20:59:14.426470+00:00 app[web.1]: I, [2017-02-24T20:59:14.426395 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Started POST "/contacts" for 188.83.235.112 at 2017-02-24 20:59:14 +0000 
2017-02-24T20:59:14.427281+00:00 app[web.1]: I, [2017-02-24T20:59:14.427232 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Processing by ContactsController#create as HTML 
2017-02-24T20:59:14.427366+00:00 app[web.1]: I, [2017-02-24T20:59:14.427324 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Parameters: {"utf8"=>"✓", "authenticity_token"=>"MgrtXM/8aUAYPnJ2ph4eIbsqMbLR/xXMZabcKmKh4myMlp0MdLJ2dCHnh7KshXSCqAsIzGQr0SdebpJw1v0QHw==", "contact"=>{"name"=>"Jesse Pinkman", "email"=>"[email protected]", "comments"=>"Yo Beach!"}, "commit"=>"Submit"} 
2017-02-24T20:59:14.429694+00:00 app[web.1]: D, [2017-02-24T20:59:14.429641 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (0.9ms) BEGIN 
2017-02-24T20:59:14.434537+00:00 app[web.1]: D, [2017-02-24T20:59:14.434485 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] SQL (1.3ms) INSERT INTO "contacts" ("name", "email", "comments", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Jesse Pinkman"], ["email", "[email protected]"], ["comments", "Yo Beach!"], ["created_at", 2017-02-24 20:59:14 UTC], ["updated_at", 2017-02-24 20:59:14 UTC]] 
2017-02-24T20:59:14.436712+00:00 app[web.1]: D, [2017-02-24T20:59:14.436665 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (1.9ms) COMMIT 
2017-02-24T20:59:14.441776+00:00 app[web.1]: I, [2017-02-24T20:59:14.441724 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendering contact_mailer/contact_email.html.erb 
2017-02-24T20:59:14.442284+00:00 app[web.1]: I, [2017-02-24T20:59:14.442237 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendered contact_mailer/contact_email.html.erb (0.4ms) 
2017-02-24T20:59:14.622612+00:00 app[web.1]: D, [2017-02-24T20:59:14.622518 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] ContactMailer#contact_email: processed outbound mail in 184.5ms 
2017-02-24T20:59:14.749027+00:00 heroku[router]: at=info method=POST path="/contacts" host=infinite-forest-28304.herokuapp.com request_id=606794a4-3f9b-417c-b3ca-72af4d8bafb6 fwd="188.83.235.112" dyno=web.1 connect=0ms service=304ms status=500 bytes=1669 
2017-02-24T20:59:14.722589+00:00 app[web.1]: I, [2017-02-24T20:59:14.722491 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Sent mail to [email protected] (99.8ms) 
2017-02-24T20:59:14.722632+00:00 app[web.1]: D, [2017-02-24T20:59:14.722588 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Date: Fri, 24 Feb 2017 20:59:14 +0000 
2017-02-24T20:59:14.722632+00:00 app[web.1]: From: [email protected] 
2017-02-24T20:59:14.722633+00:00 app[web.1]: To: [email protected] 
2017-02-24T20:59:14.722633+00:00 app[web.1]: Message-ID: <[email protected]47b44.mail> 
2017-02-24T20:59:14.722634+00:00 app[web.1]: Subject: Contact Form Message 
2017-02-24T20:59:14.722634+00:00 app[web.1]: Mime-Version: 1.0 
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Type: text/html; 
2017-02-24T20:59:14.722635+00:00 app[web.1]: charset=UTF-8 
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Transfer-Encoding: 7bit 
2017-02-24T20:59:14.722636+00:00 app[web.1]: 
2017-02-24T20:59:14.722636+00:00 app[web.1]: <!DOCTYPE html> 
2017-02-24T20:59:14.722637+00:00 app[web.1]: <html> 
2017-02-24T20:59:14.722637+00:00 app[web.1]:  <head> 
2017-02-24T20:59:14.722637+00:00 app[web.1]:  </head> 
2017-02-24T20:59:14.722638+00:00 app[web.1]:  <body> 
2017-02-24T20:59:14.722638+00:00 app[web.1]:   <p> 
2017-02-24T20:59:14.722638+00:00 app[web.1]:    You have received a message from the site's contact form, from Jesse Pinkman, [email protected] 
2017-02-24T20:59:14.722639+00:00 app[web.1]:   </p> 
2017-02-24T20:59:14.722639+00:00 app[web.1]:   <p> 
2017-02-24T20:59:14.722639+00:00 app[web.1]:    
2017-02-24T20:59:14.722640+00:00 app[web.1]:   </p> 
2017-02-24T20:59:14.722640+00:00 app[web.1]:  </body> 
2017-02-24T20:59:14.722640+00:00 app[web.1]: </html> 
2017-02-24T20:59:14.722825+00:00 app[web.1]: I, [2017-02-24T20:59:14.722779 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Completed 500 Internal Server Error in 295ms (ActiveRecord: 4.1ms) 
2017-02-24T20:59:14.723286+00:00 app[web.1]: F, [2017-02-24T20:59:14.723242 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] 
2017-02-24T20:59:14.723324+00:00 app[web.1]: F, [2017-02-24T20:59:14.723287 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email. 
2017-02-24T20:59:14.723325+00:00 app[web.1]:): 
2017-02-24T20:59:14.723357+00:00 app[web.1]: F, [2017-02-24T20:59:14.723324 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] 
2017-02-24T20:59:14.723390+00:00 app[web.1]: F, [2017-02-24T20:59:14.723357 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] app/controllers/contacts_controller.rb:15:in `create' 
2017-02-24T21:30:27.890702+00:00 heroku[router]: at=info method=GET path="/" host=infinite-forest-28304.herokuapp.com request_id=ef1e2185-e94e-4a90-907e-15dad519fd59 fwd="188.83.235.112" dyno=web.1 connect=1ms service=6ms status=200 bytes=2753 
2017-02-24T21:30:27.866291+00:00 app[web.1]: I, [2017-02-24T21:30:27.866202 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Started GET "/" for 188.83.235.112 at 2017-02-24 21:30:27 +0000 
2017-02-24T21:30:27.867090+00:00 app[web.1]: I, [2017-02-24T21:30:27.867030 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Processing by PagesController#home as HTML 
2017-02-24T21:30:27.868034+00:00 app[web.1]: I, [2017-02-24T21:30:27.867962 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Rendering pages/home.html.erb within layouts/application 
2017-02-24T21:30:27.868172+00:00 app[web.1]: I, [2017-02-24T21:30:27.868117 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Rendered pages/home.html.erb within layouts/application (0.0ms) 
2017-02-24T21:30:27.869109+00:00 app[web.1]: I, [2017-02-24T21:30:27.869058 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) 
2017-02-24T21:30:28.039850+00:00 heroku[router]: at=info method=GET path="/assets/application-5ed627eba0abe94ba4e2c255c2298f55d9bca9b4ea45ded59ba1705edc5385d0.css" host=infinite-forest-28304.herokuapp.com request_id=f9b48384-ae99-4f9e-b035-6624ef9d2ce6 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T21:30:28.051038+00:00 heroku[router]: at=info method=GET path="/assets/application-95163fa38446d1bb6139f870d5fb932af7fa47b347b8951923c32a4565386aa6.js" host=infinite-forest-28304.herokuapp.com request_id=7b1f62bf-5aca-4ac1-b926-5c3219b3ccac fwd="188.83.235.112" dyno=web.1 connect=1ms service=2ms status=304 bytes=48 
2017-02-24T21:30:28.279062+00:00 heroku[router]: at=info method=GET path="/assets/font-awesome/fontawesome-webfont-2932abf996373e87fbf2e950876b1962f1b57db954a1643ea68831d9fbb74da4.woff2?v=4.6.2" host=infinite-forest-28304.herokuapp.com request_id=d1522ce1-c16b-4525-aa55-08c6f45713c8 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
2017-02-24T21:30:29.186402+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=1cec8754-06b9-4b20-ad32-77976a359e33 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48 
+1

請通過在您的應用程序目錄中的命令shell中運行heroku日誌來發布日誌 –

+0

如果您的配置有問題,請檢查它,如果這是您的導軌代碼有問題,請發佈代碼 –

+0

@KcUS_unico您好,當我做「heroku日誌」時,我收到了很多東西......我甚至不知道從哪裏開始複製。在收到錯誤之後,我會從日誌中複製一份副本,同時從您希望看到的代碼中選擇哪一部分。任何特定的控制器,郵件或其他? – samureira

回答

1

讀取錯誤消息:

Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email. 

只要啓動你的帳戶。

+0

帳戶自開始以來一直處於激活狀態,因爲它顯示「看起來這個帳戶已被激活。」但仍然不起作用。當我要求重新發送激活時,我收到MailGun發送的「服務器錯誤/發生內部服務器錯誤」。還是要謝謝你的幫助。 – samureira

+0

對不起,它沒有工作。不幸的是,這些日誌只會說該帳戶未被激活。 Sendgrid是另一家提供免費計劃的郵件提供商,可以與heroku合作。 –

1

好的。正如日誌所說,並且@GrahamSlick已經回答,您的mailgun帳戶未經驗證。如果您聲稱該帳戶已通過驗證,請確保您在 config/environment.rb中使用的憑證是屬於經過驗證的帳戶的正確憑證,並確保heroku使用正確的憑證。日誌表示您的帳戶未驗證。也許你想再次使用mailgun檢查你的設置,看看他們是否告訴你有關非活動帳戶的信息。祝你好運。

+0

帳戶自開始以來一直處於激活狀態,因爲它顯示「看起來這個帳戶已被激活。」但仍然不起作用。當我要求重新發送激活時,我收到MailGun發送的「服務器錯誤/發生內部服務器錯誤」。還是要謝謝你的幫助。 – samureira

1

你必須添加一個域,驗證它,然後你可以發送mailgun郵件。

+0

如果您已經添加了域名,但仍然無法使用,那麼您可以在mailgun支持上添加票證來驗證它。 – puneet18

0

我遇到了完全相同的問題。我甚至試着用CURL來確保它與rails或heroku無關。我仔細檢查了我的域名已被驗證。

我最終打開了支持票。他們在幾個小時內回到我身邊,並說「現在很好走」,並且確實有效。

因此,這可能是他們的錯誤,或者他們故意要求對某些帳戶進行手動監督。不是很好的第一印象,但很高興看到他們的支持響應迅速。

相關問題