davidcelis/recommendable — Issue #3: Unable to get recommendations
Author: paniwani
Created: 2012-02-09 19:04:15+00:00
State: open

The likes and dislikes worked perfectly with my user model in the console, however I'm not able to generate recommendations. I opened `reque-web` and the stats page seems to indicate that the jobs have not failed.

I just tested it with two users each liking one overlapping recipe. The first user's recommendations fail with the error below and the similar ratings is empty. The second user's similar raters does work correctly, but the recommendations still produce this `zunionstore` error. Any advice?

```
1.9.3-p0 :002 > user.recommendations
(0.1ms) SELECT COUNT(*) FROM "likes" WHERE "likes"."user_id" = 1
(0.1ms) SELECT COUNT(*) FROM "dislikes" WHERE "dislikes"."user_id" = 1
RuntimeError: ERR wrong number of arguments for 'zunionstore' command
from /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/redis-2.2.2/lib/redis/client.rb:47:in `call'
from /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/redis-2.2.2/lib/redis.rb:660:in `block in zunionstore'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/redis-2.2.2/lib/redis.rb:659:in `zunionstore'
from /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/recommendable-0.1.3/lib/recommendable/acts_as_recommended_to.rb:351:in `recommendations'
from (irb):2
from /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start'
from /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start'
from /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:41:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
1.9.3-p0 :003 > user.similar_raters
User Load (0.2ms) SELECT "users".* FROM "users" WHERE (ID IN (NULL))
[]
```