简体   繁体   English

已安装Searchlogic gem,但无法访问方法

[英]Searchlogic gem installed, but I can't access methods

I've just installed the searchlogic gem, but when I try to access basic methods via the console, I'm getting the following error: 我刚刚安装了searchlogic gem,但是当我尝试通过控制台访问基本方法时,出现以下错误:

>> User.username_not_null
NoMethodError: undefined method `username_not_null' for #<Class:0x1033a1d90>
    from /Library/Ruby/Gems/1.8/gems/searchlogic-2.4.27/lib/searchlogic/named_scopes/conditions.rb:81:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/searchlogic-2.4.27/lib/searchlogic/named_scopes/association_conditions.rb:19:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/searchlogic-2.4.27/lib/searchlogic/named_scopes/association_ordering.rb:27:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/searchlogic-2.4.27/lib/searchlogic/named_scopes/ordering.rb:30:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/searchlogic-2.4.27/lib/searchlogic/named_scopes/or_conditions.rb:28:in `method_missing'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in `method_missing'
    from (irb):1

I'm still getting the hang of Gems, which often throw me for a loop -- can anyone point me in the right direction to fix this? 我仍然无法掌握Gems的常识,这常常使我陷入困境-有人能指出我正确的方向来解决此问题吗?

不要将Searchlogic用于可以将Rails用于以下用途:

 User.all(:conditions => ["username IS NOT NULL"])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM