2017-02-24 53 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无关。我仔细检查了我的域名已被验证。

我最终打开了支持票。他们在几个小时内回到我身边,并说“现在很好走”,并且确实有效。

因此,这可能是他们的错误,或者他们故意要求对某些帐户进行手动监督。不是很好的第一印象,但很高兴看到他们的支持响应迅速。

相关问题