up gem in Rails 3

I followed the gem installation steps on https://github.com/brady8/thumbs_up but ran into an error when following the usage steps.

This is taken from my User and Comment models:

class User < ActiveRecord::Base
  <some devise specific stuff>
  acts_as_voter
end

class Comment < ActiveRecord::Base
  acts_as_voteable
end

The error I'm getting is the following:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/base.rb:1008:in 'method_missing'Exiting : undefined local variable or method 'acts_as_voter' for # (NameError)

Removing the acts_as_voter line in User model eliminates the problem even though there is an 'acts_as_voteable' in the Comment model which seems to work fine then.

Any ideas?


I had the same issue after adding the thumbs_up gem to my application.

Restarting the server cleared it up for me.

链接地址: http://www.djcxy.com/p/81118.html

上一篇: RoR:ActiveRecord,NoMethodError在从AR扩展的模型中

下一篇: Rails 3中的宝石