1

Going through Daniel Kehoe's Learn Ruby on Rails book. Have tutorial successfully posting to MailChimp list in development. Pushed to heroku, and tested. When submitting email address to join newsletter, get error in logs -

2016-09-08T19:54:14.872341+00:00 app[web.1]: Completed 500 Internal Server Error in 12ms (ActiveRecord: 0.0ms) 2016-09-08T19:54:14.872876+00:00 app[web.1]: 2016-09-08T19:54:14.872878+00:00 app[web.1]: Gibbon::MailChimpError (Failed to open TCP connection to key.api.mailchimp.com:443 (getaddrinfo: Name or service not known) @title=nil, @detail=nil, @body=nil, @raw_body=nil, @status_code=nil): 2016-09-08T19:54:14.872879+00:00 app[web.1]:
app/models/visitor.rb:10:in subscribe' 2016-09-08T19:54:14.872880+00:00 app[web.1]:
app/controllers/visitors_controller.rb:10:in `create'

Suggestions on how to troubleshoot would be appreciated.

Daniel Kehoe
  • 10,952
  • 6
  • 63
  • 82
  • "Learn Rails book" is more ambiguous than you may think. Please format your log output. My local `ping key.api.mailchimp.com` agrees, there is no such server. – valid Sep 08 '16 at 21:28
  • Can you confirm you've set the Mailchimp API key with ```heroku config:add MAILCHIMP_API_KEY```? – Daniel Kehoe Sep 09 '16 at 07:13
  • @DanielKehoe, thanks for the response and the formatting correction. The response to the config request is - MAILCHIMP_API_KEY is invalid. Must be in the format FOO=bar. Can you assist me with where to correct this? – user3779532 Sep 09 '16 at 22:28
  • See the Deploy chapter in Book Two. The details are there: ```heroku config:add MAILCHIMP_API_KEY='very_long_string' ``` – Daniel Kehoe Sep 10 '16 at 06:03

0 Answers0