joaomdmoura / gioco

A gamification gem to Ruby on Rails applications
305 stars 36 forks source link

NameError: undefined local variable or method `kinds' for main:Object #73

Closed rwwaskk closed 9 years ago

rwwaskk commented 9 years ago

Hi, I have a fresh install of gioco (1.1.1) and followed the example to set it up as,

rails g gioco:setup --points --kinds

and

rake gioco:add_badge[newbie,0,rank,true]

But I got this,

NameError: undefined local variable or method `kinds' for main:Object
/Rails/TransferHero/lib/tasks/gioco.rake:36:in `eval'
(eval):9:in `each'
(eval):9:in `block (2 levels) in <top (required)>'
/Rails/xxx/lib/tasks/gioco.rake:36:in `eval'
/Rails/xxx/lib/tasks/gioco.rake:36:in `block (2 levels) in <top (required)>'

I went to the file and found that at link 36 it has,

 r.points  << Point.create({ :kind_id => kinds.id, :value => '#{args.points}'})

I changed kinds.id to kind.idand it worked.

Did I miss somthing? Or is it possibly a typo?

joaomdmoura commented 9 years ago

Hey @rwwaskk actually the gem is a little outdated, I'm planning to update it in the next weeks, but I'm really focused on AMS right now.

But, no worries, if you want, you can also try our pro version (http://gioco.pro). It has a free plan and a lot of cool features. It's fully working, and I'm really proud of it :)

Let me know if you have any problems!

rwwaskk commented 9 years ago

@joaomdmoura Thanks for the reply. Does it have a frontend or a preset of badges, etc ? I need to inform other developers to make a decision. Thanks again and good job :)

joaomdmoura commented 9 years ago

@rwwaskk Yeah. It's actually event-driven. You send events to gioco.pro and in it's dashboard you can create badges, levels or points that will be won by accomplishing those events that you defined. You only have to work on the html that will display the badges, levels or points.

Example: You send a event 'User Commented' with the user.id every time he clicks at submit comment button. Then at Giocos dashboard you can define a heavy commenter badge (add it's image too) that will be won by every user that accomplish the 'User Commented' 5 times.