Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Daniel Beasley
Daniel Beasley
4,824 Points

SocketError (getaddrinfo: Name or service not known):

Once pushed to heroku I receive this error upon trying to create a friendship... I believe the prob has to do with the actual sending of emails... But I'm not sure.. Anyone have any ideas? I have googled this for days and can not figure out what to do..

Any info on how to change Sockets would be helpful or a direction where I can find more info... Thanks,

Daniel

All my code matches the treebook app... Also everything works on localhost

2013-04-05T15:52:19+00:00 app[web.1]:   app/models/user_friendship.rb:54:in `send_request_email'
2013-04-05T15:52:19+00:00 app[web.1]: 
2013-04-05T15:52:19+00:00 app[web.1]: Sent mail to jennsb@gmail.com (113ms)
2013-04-05T15:52:19+00:00 app[web.1]: Completed 500 Internal Server Error in 460ms
2013-04-05T15:52:19+00:00 app[web.1]: 
2013-04-05T15:52:19+00:00 app[web.1]:   app/models/user_friendship.rb:41:in `block in request'
2013-04-05T15:52:19+00:00 app[web.1]: SocketError (getaddrinfo: Name or service not known):
2013-04-05T15:52:19+00:00 app[web.1]:   app/models/user_friendship.rb:37:in `request'
2013-04-05T15:52:19+00:00 app[web.1]: 
2013-04-05T15:52:19+00:00 app[web.1]:   app/controllers/user_friendships_controller.rb:46:in `create'
2013-04-05T15:52:19+00:00 app[web.1]: 
2013-04-05T15:51:23+00:00 heroku[web.1]: State changed from up to starting

3 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Daniel,

Try installing the Sendgrid addon in order to send emails on Heroku https://addons.heroku.com/sendgrid. Sorry about that! We'll need to address this in the videos.

Daniel Beasley
Daniel Beasley
4,824 Points

Thanks for pointing me in the right direction! I'll get on it!

Daniel Beasley
Daniel Beasley
4,824 Points

Hey Jason I got it to work... Thought I would share after a few hours of research this also helped me get it going...

http://stackoverflow.com/questions/6019083/setting-up-devise-sendgrid-on-heroku

Thanks again!