我正在尝试在Windows7中安装acts_as_ferret,但遇到错误
使用acts as-taggable-on (2.1.1)
Installing jk-ferret (0.11.8.3) with native extensions C:/RailsInstaller/Ruby1.9
.2/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in bui
ld_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::Ex
tensionBuildError)
C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb创建Makefile
我的gem文件包含以下gem列表
gem 'rails', '3.0.1'
gem 'mysql', '2.8.1'
gem 'contacts', '1.2.4'
gem 'hpricot'
gem 'db_populate'
gem 'gravtastic'
gem 'acts_as_ferret'
gem 'packet'
gem 'rmagick','2.9.1'
gem 'fastercsv'
gem 'will_paginate','3.0.pre2'
gem 'aws-s3', :require => 'aws/s3'
gem 'thinking-sphinx', '2.0.0', :require => 'thinking_sphinx'
#gem 'ckeditor', :git => 'git://github.com/galetahub/rails-ckeditor.git', :branch => 'rails3'
#gem 'ckeditor', '3.4.0.pre', :path => 'vendor/ckeditor-3.4.0.pre'
gem 'ckeditor', '3.5.4', :path => 'vendor/ckeditor-3.5.4'
gem 'mongrel'
gem 'acts_as_tree'
gem 'acts-as-taggable-on'
gem 'seed-fu'
gem 'RedCloth'
gem 'ryanb-acts-as-list'
gem 'tzinfo'
gem 'authlogic'
gem 'oauth'
gem 'authlogic-oauth'
gem "paperclip", "~> 2.3"
gem 'rails-erd'
gem 'crypt', :require => 'crypt/blowfish'
gem "pdfkit", :git => "https://github.com/huerlisi/PDFKit.git"
gem 'ssl_requirement'有谁能给我提个解决方案。
发布于 2011-12-18 03:56:56
井。这可能不是你问题的直接解决方案。但是,你应该在其他地方寻找在Rails3中的搜索。
来自acts_as_ferret自述文件
aaf is not yet ready for Rails3. Feel free to submit patches!
Rails 3 :More Like this no longer works for unsaved records (test fails in
content_test.rb test_more_like_this_new_record)
Rails 3: Sorting does not work - causes failure in sorting test & pagination test.它也没有得到良好的维护。如果你这样做,搜索"acts_as_ferret窗口“。你会经常看到"buggy“这个词。
所以。做什么?
1.创建自己的简单搜索
这是为《模型邮报》写的。posts/index.html.erb
<%= form_tag posts_path, :method => 'get' do %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
</p>
<% end %>posts_controller.rb
def index
@posts = Post.search(params[:search])
endmodels/post.rb
def self.search(search)
if search
where('title LIKE ? OR text LIKE ?', "%#{search}%", "%#{search}%" )
else
scoped
end
end2.创建全文搜索
在全文搜索中,您将获得与普通web搜索引擎相同的功能。你可以做“测试+工作”等等。
如果你真的需要全文搜索,你应该去看看。
Sphinx
Sunspot
和elasticsearch
Episode 120: Thinking Sphinx (revised)
Episode 278: Searching with Sunspot
Episode 307: ElasticSearch Part 2 (pro)
Episode 306:Elasticsearch Part 1
https://stackoverflow.com/questions/8547218
复制相似问题