It looks like you don't have a Friend class which the belongs_to is looking for. I suspect that the friend relation is also a supposed to be a User object, in which case you need something like this:
class UserFriendship < ActiveRecord::Base
belongs_to :user
belongs_to :friend, class_name: "User"
end