问题是有一个 rubygem 向 RoR ActiveRecord 添加了一些语法糖,用于定义过滤器和订单。我们使用 meta_where,然后切换到 squeel 以获得 rails 3 支持。问题是 ActiveRecord <= 3.0.10 一切正常,现在当我尝试在 gem 中切换到 3.1.0 时,我收到了这个错误:
/Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activerecord-3.1.0/lib/active_record/named_scope.rb:194:in `valid_scope_name?': private method `warn' called for nil:NilClass (NoMethodError)
整个轨迹如下:
/Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activerecord-3.1.0/lib/active_record/named_scope.rb:194:in `valid_scope_name?': private method `warn' called for nil:NilClass (NoMethodError)
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activerecord-3.1.0/lib/active_record/named_scope.rb:175:in `scope'
from ./test/simplificator_filter/filterable/filterable_test.rb:12
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@filters/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from /Users/admin/.rvm/gems/ree-1.8.7-2011.03@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
耙中止!
我搜索了类似的错误,但一无所获(主要是痕迹)。有谁知道可能是什么问题?
先感谢您。干杯,内森