简体   繁体   中英

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:

>> 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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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