如何让 searchlogic 与 Rails 3 配合使用?

发布于 2024-09-27 17:40:57 字数 2296 浏览 4 评论 0原文

我将 searchlogic 放入我的 gemfile...现在我的 Rails 服务器无法启动 :(

这是错误消息

gems/ruby-1.8.7-p299/gems/activesupport-3.0.0/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method': undefined method `merge_joins' for class `Class' (NameError)
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic/active_record/consistency.rb:8:in `included'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic/active_record/consistency.rb:7:in `class_eval'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic/active_record/consistency.rb:7:in `included'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic.rb:34:in `include'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic.rb:34
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler.rb:112:in `require'
 from /Users/omiohoro/glowing-rain-75/config/application.rb:7
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:28:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:28
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:27:in `tap'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:27
 from script/rails:6:in `require'
 from script/rails:6

我该如何解决这个问题?提前致谢 欢呼塔巴鲁加

I put searchlogic in my gemfile... and now my rails server won't start :(

this is the errormessage

gems/ruby-1.8.7-p299/gems/activesupport-3.0.0/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method': undefined method `merge_joins' for class `Class' (NameError)
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic/active_record/consistency.rb:8:in `included'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic/active_record/consistency.rb:7:in `class_eval'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic/active_record/consistency.rb:7:in `included'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic.rb:34:in `include'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/searchlogic-2.4.27/lib/searchlogic.rb:34
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/bundler-1.0.0/lib/bundler.rb:112:in `require'
 from /Users/omiohoro/glowing-rain-75/config/application.rb:7
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:28:in `require'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:28
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:27:in `tap'
 from /Users/omiohoro/.rvm/gems/ruby-1.8.7-p299/gems/railties-3.0.0/lib/rails/commands.rb:27
 from script/rails:6:in `require'
 from script/rails:6

How Do I fix this? Thanks in advance
cheers tabaluga

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

罪歌 2024-10-04 17:40:57

github 上有 railsdog 的 searchlogic fork,它支持 Rails 3。

您可以将其添加到 Gemfile 中,如下所示:

gem 'rd_searchlogic', :require => 'searchlogic', :git => 'git://github.com/railsdog/searchlogic.git'

There's the railsdog's searchlogic fork on github that supports Rails 3.

You can add it to your Gemfile like this:

gem 'rd_searchlogic', :require => 'searchlogic', :git => 'git://github.com/railsdog/searchlogic.git'
云朵有点甜 2024-10-04 17:40:57

在 Rails 3 中,您可以使用 meta_search 代替。

它与searchlogic非常相似,但

<%= order @search, :by => :name, :as => "Order By Name" %>

改为

<%= sort_link @search, :name, "Order By Name" %>

In rails 3, you could use meta_search instead.

It is very similar to searchlogic but

<%= order @search, :by => :name, :as => "Order By Name" %>

is changed to

<%= sort_link @search, :name, "Order By Name" %>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文