Skip to content

Instantly share code, notes, and snippets.

@akatz
Forked from meltzerj/gist:975201
Created May 16, 2011 20:05
Show Gist options
  • Save akatz/975232 to your computer and use it in GitHub Desktop.
Save akatz/975232 to your computer and use it in GitHub Desktop.
rake aborted!
Don't know how to build task ':best_referral'
(See full trace by running task with --trace)
(in /app)
new-computers-computer:signup newcomputer$ heroku rake :best_referral --trace
rake aborted!
Don't know how to build task ':best_referral'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/usr/ruby1.8.7/bin/rake:19:in `load'
/usr/ruby1.8.7/bin/rake:19
(in /app)
task :best_referral => :environment do
SignedUser.all.each do |user|
if current_max_user == nil
current_max_user = user
elsif user.invitation.recipients.count > current_max_user.invitation.recipients.count
current_max_user = user
end
end
puts "Winner:#{current_max_user.name} Id:#{current_max_user.id}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment