Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Andrew Bernard
Andrew Bernard
23,262 Points

Just finished Building Social Features in Ruby on Rails and Live site is having issues.

I just finished the Building Social Features in Ruby on Rails. Deployed it to Heroku and I cannot get the "Add Friend" button to function. Everything is working locally. No issues no errors. On the live site I can click on the gravatar to go to their profile page to add them. When I try to click the "Add Friend" button nothing happens at all. And if I then try to click on my Friends Link at the top it signs me out of my account.

My site is at http://annexapps.herokuapp.com/ if you want to see for yourself what is going on. Thanks. Love Treehouse!!!!

Andrew Bernard
Andrew Bernard
23,262 Points

My stylesheets and js are not being loaded to the site when I use the method below. If I add each sheet to the application.html.erb page then at least the style sheets load. But the reason that things are not working above is that the style sheet is still not loading no matter how I have it. Below is what my live page source displays. It is not giving me the list of files that are in the folders like I see it does in the lesson videos.

  <link href="/assets/application-9e3936e3849992ba11d70836d10f7581.css" media="all" rel="stylesheet" type="text/css" />
  <script src="/assets/application-ee1af7c2e47c4c8580c38ab04651f495.js" type="text/javascript"></script>
  <meta content="authenticity_token" name="csrf-param" />
<meta content="GMLYB6TxIgnluxnGgPAGfqkc20xIOcOhhruP4FsSx6o=" name="csrf-token" />
</head>

11 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey aviral prakash it looks like your account credentials aren't set up. I can tell that based on the following in the error message:

Completed 500 Internal Server Error in 494.7ms 2014-07-30T05:35:56.645464+00:00 app[web.1]:     Postmark::InvalidMessageError (No A ccount or Server API tokens were supplied in the HTTP headers.)

Try double checking everything and give it another shot :)

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi Andy Bernard,

When I first read your question, I assumed the same thing: Sounds like your stylesheets and JavaScripts are not being loaded properly. Glad that we're on the same page there. :)

I'm not sure why it would give you invalid file paths like that. In Rails, your layout.html.erb template should have lines that look like this:

<%= stylesheet_link_tag    "application", :media => "all" %>
<%= javascript_include_tag "application" %>

I'm guessing you've already checked there though. Sorry I couldn't be of more help. Jason Seifer might be able to provide you with a better answer!

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

I'm getting an error when I go to that page :(

From your treebook app on the command line, try running the following:

heroku logs --tail

That would give you some output about what is going on. Try pasting that here and we'll go from there.

My "Add Friend" also works locally but did nothing after deploying to Heroku.

In Chrome's Developer Tools > Console, this is the error I get when clicking the "Add Friend" button:

Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://treehouse-treebook.herokuapp.com/user_friendships?user_friendship%5Bfriend_id%5D=joeblow

Ignore the logs below.

2013-08-01T04:49:28.337717+00:00 app[web.1]: 14: </div> 2013-08-01T04:49:28.337717+00:00 app[web.1]: 2013-08-01T04:49:28.337717+00:00 app[web.1]: 11: <div class="row"> 2013-08-01T04:49:28.337900+00:00 app[web.1]: 2013-08-01T04:49:28.337717+00:00 app[web.1]: ActionView::Template::Error (undefi ned method `gravatar_url' for nil:NilClass): 2013-08-01T04:49:28.337717+00:00 app[web.1]: 13: <%= link_to image _tag(status.user.gravatar_url), profile_path(status.user) %> 2013-08-01T04:49:28.337717+00:00 app[web.1]: 12: <div class="span1">

2013-08-01T04:49:28.337717+00:00 app[web.1]: 15: <div class="span7">

2013-08-01T04:49:28.337717+00:00 app[web.1]: app/views/statuses/index.html.erb :13:in block in _app_views_statuses_index_html_erb___1691957763936680669_289293 60' 2013-08-01T04:49:28.337900+00:00 app[web.1]: app/views/statuses/index.html.erb :7:ineach' 2013-08-01T04:49:28.337900+00:00 app[web.1]: app/views/statuses/index.html.erb :7:in _app_views_statuses_index_html_erb___1691957763936680669_28929360' 2013-08-01T04:49:28.337900+00:00 app[web.1]: app/controllers/statuses_controll er.rb:8:inindex' 2013-08-01T04:49:28.337717+00:00 app[web.1]: 16: <strong><%= statu s.user.full_name %></strong> 2013-08-01T04:49:28.337900+00:00 app[web.1]: 2013-08-01T04:49:28.342907+00:00 heroku[router]: at=info method=GET path=/ host= treehouse-treebook.herokuapp.com fwd="184.75.221.3" dyno=web.1 connect=2ms servi ce=39ms status=500 bytes=643 2013-08-01T04:49:29.267806+00:00 app[web.1]: Started GET "/" for 184.75.221.3 at 2013-08-01 04:49:29 +0000 2013-08-01T04:49:29.273243+00:00 app[web.1]: Processing by StatusesController#in dex as HTML 2013-08-01T04:49:29.283654+00:00 app[web.1]: Completed 500 Internal Server Error in 10ms 2013-08-01T04:49:29.282882+00:00 app[web.1]: Rendered statuses/index.html.erb within layouts/application (6.0ms) 2013-08-01T04:49:29.288909+00:00 app[web.1]: 2013-08-01T04:49:29.288909+00:00 app[web.1]: ActionView::Template::Error (undefi ned method `gravatar_url' for nil:NilClass): 2013-08-01T04:49:29.288909+00:00 app[web.1]: 13: <%= link_to image _tag(status.user.gravatar_url), profile_path(status.user) %> 2013-08-01T04:49:29.288909+00:00 app[web.1]: 14: </div> 2013-08-01T04:49:29.288909+00:00 app[web.1]: 15: <div class="span7">

2013-08-01T04:49:29.288909+00:00 app[web.1]: 10: <div class="status"> 2013-08-01T04:49:29.288909+00:00 app[web.1]: 11: <div class="row"> 2013-08-01T04:49:29.288909+00:00 app[web.1]: 16: <strong><%= statu s.user.full_name %></strong> 2013-08-01T04:49:29.288909+00:00 app[web.1]: 12: <div class="span1">

2013-08-01T04:49:29.289120+00:00 app[web.1]: app/views/statuses/index.html.erb :7:in _app_views_statuses_index_html_erb___1691957763936680669_28929360' 2013-08-01T04:49:29.289120+00:00 app[web.1]: 2013-08-01T04:49:29.288909+00:00 app[web.1]: app/views/statuses/index.html.erb :13:inblock in app_views_statuses_index_html_erb__1691957763936680669_289293 60' 2013-08-01T04:49:29.289120+00:00 app[web.1]: 2013-08-01T04:49:29.289120+00:00 app[web.1]: app/views/statuses/index.html.erb :7:in each' 2013-08-01T04:49:29.289120+00:00 app[web.1]: app/controllers/statuses_controll er.rb:8:inindex' 2013-08-01T04:49:29.292043+00:00 heroku[router]: at=info method=GET path=/ host= treehouse-treebook.herokuapp.com fwd="184.75.221.3" dyno=web.1 connect=2ms servi ce=31ms status=500 bytes=643 2013-08-01T04:49:30.355140+00:00 app[web.1]: Started GET "/" for 184.75.221.3 at 2013-08-01 04:49:30 +0000 2013-08-01T04:49:30.357169+00:00 app[web.1]: Processing by StatusesController#in dex as HTML 2013-08-01T04:49:30.366081+00:00 app[web.1]: Rendered statuses/index.html.erb within layouts/application (6.6ms) 2013-08-01T04:49:30.366081+00:00 app[web.1]: Completed 500 Internal Server Error in 9ms 2013-08-01T04:49:30.367839+00:00 app[web.1]: 2013-08-01T04:49:30.367839+00:00 app[web.1]: ActionView::Template::Error (undefi ned method `gravatar_url' for nil:NilClass): 2013-08-01T04:49:30.367839+00:00 app[web.1]: 10: <div class="status"> 2013-08-01T04:49:30.367839+00:00 app[web.1]: 11: <div class="row"> 2013-08-01T04:49:30.367839+00:00 app[web.1]: 12: <div class="span1">

2013-08-01T04:49:30.367839+00:00 app[web.1]: 13: <%= link_to image _tag(status.user.gravatar_url), profile_path(status.user) %> 2013-08-01T04:49:30.367839+00:00 app[web.1]: 14: </div> 2013-08-01T04:49:30.367839+00:00 app[web.1]: 15: <div class="span7">

2013-08-01T04:49:30.367839+00:00 app[web.1]: app/views/statuses/index.html.erb :13:in block in _app_views_statuses_index_html_erb___1691957763936680669_289293 60' 2013-08-01T04:49:30.367839+00:00 app[web.1]: 16: <strong><%= statu s.user.full_name %></strong> 2013-08-01T04:49:30.368023+00:00 app[web.1]: app/views/statuses/index.html.erb :7:ineach' 2013-08-01T04:49:30.368023+00:00 app[web.1]: app/views/statuses/index.html.erb :7:in _app_views_statuses_index_html_erb___1691957763936680669_28929360' 2013-08-01T04:49:30.368023+00:00 app[web.1]: app/controllers/statuses_controll er.rb:8:inindex' 2013-08-01T04:49:30.368023+00:00 app[web.1]: 2013-08-01T04:49:30.368023+00:00 app[web.1]: 2013-08-01T04:49:30.368558+00:00 heroku[router]: at=info method=GET path=/ host= treehouse-treebook.herokuapp.com fwd="184.75.221.3" dyno=web.1 connect=2ms servi ce=22ms status=500 bytes=643 2013-08-01T04:53:07.986316+00:00 app[web.1]: Started GET "/" for 184.75.221.3 at 2013-08-01 04:53:07 +0000 2013-08-01T04:53:07.995131+00:00 app[web.1]: Processing by StatusesController#in dex as HTML 2013-08-01T04:53:08.008832+00:00 app[web.1]: Rendered statuses/index.html.erb within layouts/application (2.8ms) 2013-08-01T04:53:08.009189+00:00 app[web.1]: Completed 500 Internal Server Error in 14ms 2013-08-01T04:53:08.012377+00:00 app[web.1]: ActionView::Template::Error (undefi ned method `gravatar_url' for nil:NilClass): 2013-08-01T04:53:08.012377+00:00 app[web.1]: 2013-08-01T04:53:08.012377+00:00 app[web.1]: 11: <div class="row"> 2013-08-01T04:53:08.012377+00:00 app[web.1]: 13: <%= link_to image _tag(status.user.gravatar_url), profile_path(status.user) %> 2013-08-01T04:53:08.012377+00:00 app[web.1]: 14: </div> 2013-08-01T04:53:08.012377+00:00 app[web.1]: 10: <div class="status"> 2013-08-01T04:53:08.012377+00:00 app[web.1]: 12: <div class="span1">

2013-08-01T04:53:08.012571+00:00 app[web.1]: 2013-08-01T04:53:08.012377+00:00 app[web.1]: 16: <strong><%= statu s.user.full_name %></strong> 2013-08-01T04:53:08.012377+00:00 app[web.1]: 15: <div class="span7">

2013-08-01T04:53:08.012377+00:00 app[web.1]: app/views/statuses/index.html.erb :13:in block in _app_views_statuses_index_html_erb___1691957763936680669_289293 60' 2013-08-01T04:53:08.012571+00:00 app[web.1]: app/controllers/statuses_controll er.rb:8:inindex' 2013-08-01T04:53:08.012571+00:00 app[web.1]: app/views/statuses/index.html.erb :7:in each' 2013-08-01T04:53:08.012571+00:00 app[web.1]: app/views/statuses/index.html.erb :7:inapp_views_statuses_index_html_erb__1691957763936680669_28929360' 2013-08-01T04:53:08.012571+00:00 app[web.1]: 2013-08-01T04:53:08.015766+00:00 heroku[router]: at=info method=GET path=/ host= treehouse-treebook.herokuapp.com fwd="184.75.221.3" dyno=web.1 connect=12ms serv ice=35ms status=500 bytes=643 2013-08-01T05:02:22.618267+00:00 heroku[api]: Starting process with command bun dle exec rake db:version by tysonpitt@gmail.com 2013-08-01T05:02:28.093225+00:00 heroku[run.8498]: Awaiting client 2013-08-01T05:02:28.122776+00:00 heroku[run.8498]: Starting process with command bundle exec rake db:version 2013-08-01T05:02:29.524531+00:00 heroku[run.8498]: State changed from starting t o up 2013-08-01T05:02:51.289901+00:00 heroku[run.8498]: State changed from up to comp lete 2013-08-01T05:02:51.275070+00:00 heroku[run.8498]: Process exited with status 0 2013-08-01T05:05:04.127927+00:00 app[web.1]: Started GET "/" for 184.75.221.3 at 2013-08-01 05:05:04 +0000 2013-08-01T05:05:04.131112+00:00 app[web.1]: Processing by StatusesController#in dex as HTML 2013-08-01T05:05:04.136144+00:00 app[web.1]: Rendered statuses/index.html.erb within layouts/application (2.9ms) 2013-08-01T05:05:04.136322+00:00 app[web.1]: Completed 500 Internal Server Error in 5ms 2013-08-01T05:05:04.138394+00:00 app[web.1]: 2013-08-01T05:05:04.138394+00:00 app[web.1]: ActionView::Template::Error (undefi ned method `gravatar_url' for nil:NilClass): 2013-08-01T05:05:04.138394+00:00 app[web.1]: 10: <div class="status"> 2013-08-01T05:05:04.138394+00:00 app[web.1]: 12: <div class="span1">

2013-08-01T05:05:04.138394+00:00 app[web.1]: 11: <div class="row"> 2013-08-01T05:05:04.138394+00:00 app[web.1]: 14: </div> 2013-08-01T05:05:04.138394+00:00 app[web.1]: 15: <div class="span7">

2013-08-01T05:05:04.138394+00:00 app[web.1]: 13: <%= link_to image tag(status.user.gravatar_url), profile_path(status.user) %> 2013-08-01T05:05:04.138394+00:00 app[web.1]: 16: <strong><%= statu s.user.full_name %></strong> 2013-08-01T05:05:04.138394+00:00 app[web.1]: app/views/statuses/index.html.erb :13:in `block in _app_views_statuses_index_html_erb1691957763936680669_289293 60' 2013-08-01T05:05:04.138589+00:00 app[web.1]: 2013-08-01T05:05:04.138589+00:00 app[web.1]: 2013-08-01T05:05:04.138589+00:00 app[web.1]: app/views/statuses/index.html.erb :7:in each' 2013-08-01T05:05:04.138589+00:00 app[web.1]: app/controllers/statuses_controll er.rb:8:inindex' 2013-08-01T05:05:04.138589+00:00 app[web.1]: app/views/statuses/index.html.erb :7:in `_app_views_statuses_index_html_erb_1691957763936680669_28929360' 2013-08-01T05:05:04.181936+00:00 heroku[router]: at=info method=GET path=/ host= treehouse-treebook.herokuapp.com fwd="184.75.221.3" dyno=web.1 connect=2ms servi ce=60ms status=500 bytes=643

Jason Seifer
Jason Seifer
Treehouse Guest Teacher

It looks like your status is missing an associated user record. Can you perhaps run the following:

heroku run rails console

Then:

Status.where("user_id is null").each{|status| status.update_attribute(:user_id, User.first.id)}

This will assign all statuses without a user to the first one in the system.

This didn't seem to help.

No new error, same as before.

I haven't been able to solve this issue.

Was the problem ever fixed?

I am also getting the same problem. Everything works fine on my local server but when i'm trying to add a friend on the heroku server the request isn't going through. perhaps we should blame heroku?

Tony McKeown
PLUS
Tony McKeown
Courses Plus Student 14,300 Points

I don't suppose either @Justin Licata or @Andy Bernard got this resolved?

I've spent the last few hours trying to get this to work but every solution I've tried using the other threads that I found on search seems to make it even worse on heroku!

Tony McKeown
Tony McKeown
Courses Plus Student 14,300 Points

Opps mucked up the tagging in the last post and won't let me update the tagging when editing my message. Justin Licata / Andy Bernard

Sorry Tony but I wasn't able to figure out the solution to the problem. Hope you have better luck than me

Tony McKeown
PLUS
Tony McKeown
Courses Plus Student 14,300 Points

Thanks for responding. I'll just keep plugging away to see if I can fix it. The most frustrating thing is that every time I try and fix the error by doing something different it breaks the app completely and then I have to roll back to a previous version and it seems to take me an age to get heroku back to the previous stage.

Yea I could have sworn that in one part of the tutorial the button worked. I feel like something we did towards the end of the tutorial broke it

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

For those still having issues, can you run the following:

heroku logs --tail

Then try adding the friend and pasting the output from the logs here?

Tony McKeown
Tony McKeown
Courses Plus Student 14,300 Points

2013-08-29T13:44:00.338224+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783841 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=33ms status=200 bytes=2 2013-08-29T13:44:05.451730+00:00 app[web.1]: Started GET "/activities.json?since=1377783846" for 86.19.232.26 at 2013-08-29 13:44:05 +0000 2013-08-29T13:44:05.464970+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:05.469652+00:00 app[web.1]: Parameters: {"since"=>"1377783846"} 2013-08-29T13:44:05.553357+00:00 app[web.1]: Completed 200 OK in 83ms (Views: 1.0ms | ActiveRecord: 1.6ms) 2013-08-29T13:44:05.560535+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783846 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=3ms service=244ms status=200 bytes=2 2013-08-29T13:44:10.325839+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:10.321270+00:00 app[web.1]: Started GET "/activities.json?since=1377783851" for 86.19.232.26 at 2013-08-29 13:44:10 +0000 2013-08-29T13:44:10.325839+00:00 app[web.1]: Parameters: {"since"=>"1377783851"} 2013-08-29T13:44:10.342665+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783851 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=5ms service=27ms status=200 bytes=2 2013-08-29T13:44:10.337882+00:00 app[web.1]: Completed 200 OK in 12ms (Views: 0.7ms | ActiveRecord: 1.5ms) 2013-08-29T13:44:15.332109+00:00 app[web.1]: Started GET "/activities.json?since=1377783856" for 86.19.232.26 at 2013-08-29 13:44:15 +0000 2013-08-29T13:44:15.336818+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:15.337038+00:00 app[web.1]: Parameters: {"since"=>"1377783856"} 2013-08-29T13:44:15.356579+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783856 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=36ms status=200 bytes=2 2013-08-29T13:44:15.353913+00:00 app[web.1]: Completed 200 OK in 17ms (Views: 0.8ms | ActiveRecord: 2.0ms) 2013-08-29T13:44:20.310817+00:00 app[web.1]: Started GET "/activities.json?since=1377783861" for 86.19.232.26 at 2013-08-29 13:44:20 +0000 2013-08-29T13:44:20.314439+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:20.314439+00:00 app[web.1]: Parameters: {"since"=>"1377783861"} 2013-08-29T13:44:20.397245+00:00 app[web.1]: Completed 200 OK in 83ms (Views: 1.0ms | ActiveRecord: 38.6ms) 2013-08-29T13:44:20.419377+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783861 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=117ms status=200 bytes=2 2013-08-29T13:44:25.323918+00:00 app[web.1]: Started GET "/activities.json?since=1377783866" for 86.19.232.26 at 2013-08-29 13:44:25 +0000 2013-08-29T13:44:25.328273+00:00 app[web.1]: Parameters: {"since"=>"1377783866"} 2013-08-29T13:44:25.328273+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:25.378945+00:00 app[web.1]: Completed 200 OK in 50ms (Views: 3.0ms | ActiveRecord: 8.9ms) 2013-08-29T13:44:25.383526+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783866 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=5ms service=64ms status=200 bytes=2 2013-08-29T13:44:30.315927+00:00 app[web.1]: Started GET "/activities.json?since=1377783871" for 86.19.232.26 at 2013-08-29 13:44:30 +0000 2013-08-29T13:44:30.321003+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:30.321003+00:00 app[web.1]: Parameters: {"since"=>"1377783871"} 2013-08-29T13:44:30.337210+00:00 app[web.1]: Completed 200 OK in 16ms (Views: 0.7ms | ActiveRecord: 2.0ms) 2013-08-29T13:44:30.341471+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783871 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=2ms service=33ms status=200 bytes=2 2013-08-29T13:44:35.330772+00:00 app[web.1]: Started GET "/activities.json?since=1377783876" for 86.19.232.26 at 2013-08-29 13:44:35 +0000 2013-08-29T13:44:35.356803+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:35.362155+00:00 app[web.1]: Parameters: {"since"=>"1377783876"} 2013-08-29T13:44:35.391272+00:00 app[web.1]: Completed 200 OK in 14ms (Views: 0.7ms | ActiveRecord: 2.8ms) 2013-08-29T13:44:35.418044+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783876 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=115ms status=200 bytes=2 2013-08-29T13:44:40.320107+00:00 app[web.1]: Started GET "/activities.json?since=1377783881" for 86.19.232.26 at 2013-08-29 13:44:40 +0000 2013-08-29T13:44:40.324942+00:00 app[web.1]: Parameters: {"since"=>"1377783881"} 2013-08-29T13:44:40.324942+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:40.343797+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783881 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=4ms service=30ms status=200 bytes=2 2013-08-29T13:44:40.337764+00:00 app[web.1]: Completed 200 OK in 12ms (Views: 1.1ms | ActiveRecord: 1.2ms) 2013-08-29T13:44:45.314157+00:00 app[web.1]: Started GET "/activities.json?since=1377783886" for 86.19.232.26 at 2013-08-29 13:44:45 +0000 2013-08-29T13:44:45.319518+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:45.319593+00:00 app[web.1]: Parameters: {"since"=>"1377783886"} 2013-08-29T13:44:45.334528+00:00 app[web.1]: Completed 200 OK in 15ms (Views: 0.8ms | ActiveRecord: 1.9ms) 2013-08-29T13:44:45.340489+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783886 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=33ms status=200 bytes=2 2013-08-29T13:44:50.312927+00:00 app[web.1]: Started GET "/activities.json?since=1377783891" for 86.19.232.26 at 2013-08-29 13:44:50 +0000 2013-08-29T13:44:50.316828+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:50.316828+00:00 app[web.1]: Parameters: {"since"=>"1377783891"} 2013-08-29T13:44:50.327580+00:00 app[web.1]: Completed 200 OK in 11ms (Views: 0.8ms | ActiveRecord: 1.9ms) 2013-08-29T13:44:50.330610+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783891 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=2ms service=23ms status=200 bytes=2 2013-08-29T13:44:55.320398+00:00 app[web.1]: Started GET "/activities.json?since=1377783896" for 86.19.232.26 at 2013-08-29 13:44:55 +0000 2013-08-29T13:44:55.332751+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:44:55.332751+00:00 app[web.1]: Parameters: {"since"=>"1377783896"} 2013-08-29T13:44:55.368072+00:00 app[web.1]: Completed 200 OK in 35ms (Views: 0.9ms | ActiveRecord: 8.4ms) 2013-08-29T13:44:55.378621+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783896 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=9ms service=65ms status=200 bytes=2 2013-08-29T13:45:00.324929+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:00.313138+00:00 app[web.1]: Started GET "/activities.json?since=1377783901" for 86.19.232.26 at 2013-08-29 13:45:00 +0000 2013-08-29T13:45:00.324929+00:00 app[web.1]: Parameters: {"since"=>"1377783901"} 2013-08-29T13:45:00.358961+00:00 app[web.1]: Completed 200 OK in 34ms (Views: 0.9ms | ActiveRecord: 9.9ms) 2013-08-29T13:45:00.365400+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783901 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=2ms service=56ms status=200 bytes=2 2013-08-29T13:45:05.322772+00:00 app[web.1]: Started GET "/activities.json?since=1377783906" for 86.19.232.26 at 2013-08-29 13:45:05 +0000 2013-08-29T13:45 :05.330004+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:05.330122+00:00 app[web.1]: Parameters: {"since"=>"1377783906"} 2013-08-29T13:45:05.348645+00:00 app[web.1]: Completed 200 OK in 18ms (Views: 0.7ms | ActiveRecord: 4.4ms) 2013-08-29T13:45:05.352902+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783906 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=37ms status=200 bytes=2 2013-08-29T13:45:10.326436+00:00 app[web.1]: Started GET "/activities.json?since=1377783911" for 86.19.232.26 at 2013-08-29 13:45:10 +0000 2013-08-29T13:45:10.331010+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:10.331010+00:00 app[web.1]: Parameters: {"since"=>"1377783911"} 2013-08-29T13:45:10.341890+00:00 app[web.1]: Completed 200 OK in 10ms (Views: 0.8ms | ActiveRecord: 1.9ms) 2013-08-29T13:45:10.360726+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783911 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=39ms status=200 bytes=2 2013-08-29T13:45:15.348918+00:00 app[web.1]: Started GET "/activities.json?since=1377783916" for 86.19.232.26 at 2013-08-29 13:45:15 +0000 2013-08-29T13:45:15.364714+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:15.364776+00:00 app[web.1]: Parameters: {"since"=>"1377783916"} 2013-08-29T13:45:15.430473+00:00 app[web.1]: Completed 200 OK in 65ms (Views: 0.8ms | ActiveRecord: 14.1ms) 2013-08-29T13:45:15.439747+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783916 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=125ms status=200 bytes=2 2013-08-29T13:45:20.324462+00:00 app[web.1]: Started GET "/activities.json?since=1377783921" for 86.19.232.26 at 2013-08-29 13:45:20 +0000 2013-08-29T13:45:20.327878+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:20.327878+00:00 app[web.1]: Parameters: {"since"=>"1377783921"} 2013-08-29T13:45:20.343771+00:00 app[web.1]: Completed 200 OK in 16ms (Views: 1.7ms | ActiveRecord: 1.4ms) 2013-08-29T13:45:20.346036+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783921 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=5ms service=29ms status=200 bytes=2 2013-08-29T13:45:25.317768+00:00 app[web.1]: Started GET "/activities.json?since=1377783926" for 86.19.232.26 at 2013-08-29 13:45:25 +0000 2013-08-29T13:45:25.331950+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:25.331950+00:00 app[web.1]: Parameters: {"since"=>"1377783926"} 2013-08-29T13:45:25.364905+00:00 app[web.1]: Completed 200 OK in 33ms (Views: 2.4ms | ActiveRecord: 3.0ms) 2013-08-29T13:45:30.322019+00:00 app[web.1]: Started GET "/activities.json?since=1377783931" for 86.19.232.26 at 2013-08-29 13:45:30 +0000 2013-08-29T13:45:30.330886+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:30.330886+00:00 app[web.1]: Parameters: {"since"=>"1377783931"} 2013-08-29T13:45:30.384194+00:00 app[web.1]: Completed 200 OK in 53ms (Views: 1.0ms | ActiveRecord: 12.2ms) 2013-08-29T13:45:30.386566+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783931 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=75ms status=200 bytes=2 2013-08-29T13:45:25.367914+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783926 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=62ms status=200 bytes=2 2013-08-29T13:45:35.390011+00:00 app[web.1]: Started GET "/activities.json?since=1377783936" for 86.19.232.26 at 2013-08-29 13:45:35 +0000 2013-08-29T13:45:35.440495+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:35.440495+00:00 app[web.1]: Parameters: {"since"=>"1377783936"} 2013-08-29T13:45:35.672108+00:00 app[web.1]: Completed 200 OK in 227ms (Views: 2.5ms | ActiveRecord: 17.0ms) 2013-08-29T13:45:35.681955+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783936 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=2ms service=369ms status=200 bytes=2 2013-08-29T13:45:40.314047+00:00 app[web.1]: Started GET "/activities.json?since=1377783941" for 86.19.232.26 at 2013-08-29 13:45:40 +0000 2013-08-29T13:45:40.318058+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:45:40.318174+00:00 app[web.1]: Parameters: {"since"=>"1377783941"} 2013-08-29T13:45:40.332484+00:00 app[web.1]: Completed 200 OK in 14ms (Views: 0.7ms | ActiveRecord: 1.4ms) 2013-08-29T13:45:40.335117+00:00 heroku[router]: at=info method=GET path=/activities.json?since=1377783941 host=young-basin-1699.herokuapp.com fwd="86.19.232.26" dyno=web.1 connect=1ms service=27ms status=200 bytes=2

Tony McKeown
Tony McKeown
Courses Plus Student 14,300 Points

Thank you for taking the time to look at this Jason. Hopefully the above was what you were looking for.

As I said previously, it works fine on localhost but on heroku the add friend button doesn't seen to do anything.

Tony McKeown
Tony McKeown
Courses Plus Student 14,300 Points

Actually that appears to have missed a bit of the log.

2013-08-29T13:53:55.189378+00:00 app[web.1]: Started POST "/user_friendships?user_friendship%5Bfriend_id%5D=Ben" for 86.19.232.26 at 2013-08-29 13:53:55 +0000 2013-08-29T13:53:55.487223+00:00 app[web.1]: Processing by UserFriendshipsController#create as JSON 2013-08-29T13:53:55.504678+00:00 app[web.1]: Parameters: {"user_friendship"=>{"friend_id"=>"Ben"}} 2013-08-29T13:53:56.216111+00:00 app[web.1]: Rendered user_notifier/friend_requested.html.erb (0.1ms) 2013-08-29T13:53:56.449401+00:00 app[web.1]: 2013-08-29T13:53:56.449401+00:00 app[web.1]: Sent mail to thetonic2001@hotmail.com (181ms) 2013-08-29T13:53:56.490184+00:00 app[web.1]: Completed 500 Internal Server Error in 869ms 2013-08-29T13:53:56.557913+00:00 app[web.1]: 2013-08-29T13:53:56.557913+00:00 app[web.1]: Errno::ECONNREFUSED (Connection refused - connect(2)): 2013-08-29T13:53:56.557913+00:00 app[web.1]: app/models/user_friendship.rb:45:in send_request_email' 2013-08-29T13:53:56.557913+00:00 app[web.1]: app/models/user_friendship.rb:32:inblock in request' 2013-08-29T13:53:56.557913+00:00 app[web.1]: app/models/user_friendship.rb:28:in request' 2013-08-29T13:53:56.557913+00:00 app[web.1]: app/controllers/user_friendships_controller.rb:46:increate' 2013-08-29T13:53:56.557913+00:00 app[web.1]: 2013-08-29T13:53:56.557913+00:00 app[web.1]: 2013-08-29T13:53:56.561935+00:00 app[web.1]: Started GET "/activities.json?since=1377784436" for 86.19.232.26 at 2013-08-29 13:53:56 +0000 2013-08-29T13:53:56.612650+00:00 app[web.1]: Processing by ActivitiesController#index as JSON 2013-08-29T13:53:56.621324+00:00 app[web.1]: Parameters: {"since"=>"1377784436"} 2013-08-29T13:53:56.772376+00:00 app[web.1]: Completed 200 OK in 145ms (Views: 1.1ms | ActiveRecord: 9.6ms)

Jason Seifer
Jason Seifer
Treehouse Guest Teacher

It looks like your ap is having some trouble sending mail. Try installing the Postmark addon and enabling it only in production mode.

aviral prakash
aviral prakash
518 Points

Hi Jason Seifer ! I am having same issues. I also added the Postmark addon but still nothing seems to work. here is my heroku logs --tail message

2014-07-30T05:35:48.862014+00:00 app[web.1]: Processing by ProfilesController#sh ow as HTML 2014-07-30T05:35:48.862041+00:00 app[web.1]: Parameters: {"id"=>"aviral99"} 2014-07-30T05:35:48.941731+00:00 app[web.1]: Rendered profiles/show.html.erb w ithin layouts/application (20.3ms) 2014-07-30T05:35:50.074513+00:00 heroku[router]: at=info method=GET path="/user_ friendships.json" host=splitter9.herokuapp.com request_id=f6b92b82-00d4-4292-ba6 e-27a57d2f397b fwd="182.64.126.61" dyno=web.1 connect=1 service=15 status=304 by tes=1142 2014-07-30T05:35:50.059253+00:00 app[web.1]: Started GET "/user_friendships.json " for 182.64.126.61 at 2014-07-30 05:35:50 +0000 2014-07-30T05:35:50.069585+00:00 app[web.1]: Completed 200 OK in 5.9ms (Views: 0 .1ms | ActiveRecord: 0.0ms) 2014-07-30T05:35:50.062409+00:00 app[web.1]: Processing by UserFriendshipsContro ller#index as JSON 2014-07-30T05:35:56.146066+00:00 app[web.1]: Started POST "/user_friendships?use r_friendship%5Bfriend_id%5D=aviral99" for 182.64.126.61 at 2014-07-30 05:35:56 + 0000 2014-07-30T05:35:56.148771+00:00 app[web.1]: Processing by UserFriendshipsContro ller#create as JSON 2014-07-30T05:35:56.148798+00:00 app[web.1]: Parameters: {"user_friendship"=>{ "friend_id"=>"aviral99"}} 2014-07-30T05:35:56.287670+00:00 app[web.1]: Rendered user_notifier/friend_req uested.html.erb (0.6ms) 2014-07-30T05:35:56.650371+00:00 heroku[router]: at=info method=POST path="/user friendships?user_friendship%5Bfriend_id%5D=aviral99" host=splitter9.herokuapp.c om request_id=25aee485-5f7a-40ca-b6de-df2b853b0e2e fwd="182.64.126.61" dyno=web. 1 connect=1 service=508 status=500 bytes=1167 2014-07-30T05:35:56.641860+00:00 app[web.1]: 2014-07-30T05:35:56.641866+00:00 app[web.1]: Sent mail to aviralprakash@gmail.co m (350.6ms) 2014-07-30T05:35:56.643706+00:00 app[web.1]: Completed 500 Internal Server Error in 494.7ms 2014-07-30T05:35:56.645464+00:00 app[web.1]: Postmark::InvalidMessageError (No A ccount or Server API tokens were supplied in the HTTP headers.): 2014-07-30T05:35:56.645466+00:00 app[web.1]: app/models/user_friendship.rb:45: in send_request_email' 2014-07-30T05:35:56.645467+00:00 app[web.1]: app/models/user_friendship.rb:32: inblock in request' 2014-07-30T05:35:56.645472+00:00 app[web.1]: 2014-07-30T05:35:56.645470+00:00 app[web.1]: app/controllers/user_friendships controller.rb:45:in create' 2014-07-30T05:35:56.645473+00:00 app[web.1]: 2014-07-30T05:35:56.645469+00:00 app[web.1]: app/models/user_friendship.rb:28: inrequest' 2014-07-30T05:35:56.645461+00:00 app[web.1]:

Link to my app - splitter9.herokuapp.com

aviral prakash
aviral prakash
518 Points

Thanks for pointing that out! Is it necessary to create a sender signature in postmark? well if yes then what should i put in the email id from which the messages are going because postmark doesn't accept public domain names like gmail. Thanks for your help :)

Update: I was able to create a sender signature but i still get this error-

Postmark::InvalidMessageError <No Account or Server API tokens were supplied in the HTTP headers.>

What does this mean?