Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Heroku logs errors

heroku deployment production error

  • Please log in to reply
7 replies to this topic

#1 APane

APane

    Passenger

  • Members
  • 4 posts

Posted 14 August 2013 - 06:31 PM

Hey guys,

 

After creating a staging branch, I'm not sure what happened but I'm getting all of these errors in the heroku logs.

 

For example, I can no longer vote up a song on my website.

I get these errors:

https://gist.github....31b629df66b9408

 

I really need to get this working.

 

Please feel free to do what it takes to help resolve this. Codebase for the app can be seen here: www.github.com/apane/leap

 

Thanks

Anthony



#2 Jamie

Jamie

    Controller

  • Moderators
  • 114 posts
  • LocationThe UK

Posted 14 August 2013 - 06:36 PM

Would you mind sharing the SCHEMA for your votes table?


Rails developer based in Newcastle, UK.
Web app owner - Twitter lover

#3 Andre Dublin

Andre Dublin

    Signalman

  • Members
  • 13 posts
  • LocationCharleston, SC

Posted 14 August 2013 - 06:37 PM

It looks like the object that your are calling vote_for on is currently nil on line 14 of your songs_controller.

 

Make sure your are passing the object back to your controller or properly retrieving it from the database.



#4 APane

APane

    Passenger

  • Members
  • 4 posts

Posted 14 August 2013 - 06:37 PM

Sure, 
 
create_table "votes", force: true do |t|
    t.boolean  "vote",          default: false, null: false
    t.integer  "voteable_id",                   null: false
    t.string   "voteable_type",                 null: false
    t.integer  "voter_id"
    t.string   "voter_type"
    t.datetime "created_at"
    t.datetime "updated_at"
  end
 
  add_index "votes", ["voteable_id", "voteable_type"], name: "index_votes_on_voteable_id_and_voteable_type", using: :btree
  add_index "votes", ["voter_id", "voter_type", "voteable_id", "voteable_type"], name: "fk_one_vote_per_user_per_entity", unique: true, using: :btree
  add_index "votes", ["voter_id", "voter_type"], name: "index_votes_on_voter_id_and_voter_type", using: :btree


#5 Andre Dublin

Andre Dublin

    Signalman

  • Members
  • 13 posts
  • LocationCharleston, SC

Posted 14 August 2013 - 06:40 PM

I'd say the problem is at this line

 

https://github.com/A...ntroller.rb#L14

 

What view or ajax view is calling vote for?



#6 APane

APane

    Passenger

  • Members
  • 4 posts

Posted 14 August 2013 - 06:41 PM

this part here in _song.html.erb is calling the vote_for action: 

 

<div class="title">
  <%=link_to image_tag('arrow.gif'), vote_for_song_path(song), :remote => true, :method => :put  if controller.action_name == "index" %>
  <%= link_to song.title, song %><span class="subtext"> (<%= song.genres.map(&:name).join(', ') %>)</span>
</div>


#7 Andre Dublin

Andre Dublin

    Signalman

  • Members
  • 13 posts
  • LocationCharleston, SC

Posted 14 August 2013 - 06:52 PM

So it looks like your passing the song object and not the id.

 

Also I corrected myself and am now referencing line 14 in your songs controller.

 

Its been a while since I've used devise, but now I can say that your current_user object is nil, not song.



#8 APane

APane

    Passenger

  • Members
  • 4 posts

Posted 14 August 2013 - 07:05 PM

You're right about line 14, and I think that's because the user that logs in through twitter isn't labeled as a 'current_user'.







Also tagged with one or more of these keywords: heroku, deployment, production, error

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users