# Help installing Ferret

**URL:** <https://www.ruby-forum.com/t/help-installing-ferret/97514>\
**Category:** Rails\
**Created:** [July 7, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/help-installing-ferret/97514 "2006-07-07T17:14:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tripdragon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@tripdragon](https://www.ruby-forum.com/u/tripdragon)\
**Post date:** [July 7, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/help-installing-ferret/97514/1 "2006-07-07T17:14:35Z")

</div>

[http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails](http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails)

I followed everything here but at the last I get when loading page  
get\_results

Can only handle a String or a Query.  
RAILS\_ROOT: script/…/config/…

Application Trace | Framework Trace | Full Trace  
#{RAILS\_ROOT}/app/models/result.rb:27:in `search_each' #{RAILS_ROOT}/app/models/result.rb:27:in `search\_index’  
#{RAILS\_ROOT}/app/models/result.rb:15:in `count' #{RAILS_ROOT}/app/controllers/search_controller.rb:25:in `get\_results’

I’m beat, I did everything I mostly understand what is happeneing on  
the code… But still nothing

Though at  
require ‘ferret’  
module FerretConfig  
include Ferret

INDEX = Index::Index.new(:path =\>  
‘f:/home/jan/workspace/ferret\_test/index’)

end

I just changed ‘f:/home/jan/workspace/ferret\_test/index’) to ‘index’  
since it is root in my folder and i’m on OSX tiger

---

<div class="post-metadata">

**Author:** ![tripdragon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@tripdragon](https://www.ruby-forum.com/u/tripdragon)\
**Post date:** [July 7, 2006, 6:14pm UTC](https://www.ruby-forum.com/t/help-installing-ferret/97514/2 "2006-07-07T18:14:16Z")

</div>

Our site has a Ferret-based search engine on OSX and we didn’t need  
anything  
special to get it running. We do specify the full path to the index  
directory, so you may try that. Can you post the code that throws these  
errors?

Jeff

---

<div class="post-metadata">

**Author:** ![tripdragon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@tripdragon](https://www.ruby-forum.com/u/tripdragon)\
**Post date:** [July 7, 2006, 6:37pm UTC](https://www.ruby-forum.com/t/help-installing-ferret/97514/3 "2006-07-07T18:37:24Z")

</div>

Jeff Everett wrote:

> Our site has a Ferret-based search engine on OSX and we didn’t need  
> anything  
> special to get it running. We do specify the full path to the index  
> directory, so you may try that. Can you post the code that throws these  
> errors?
> 
> Jeff

```auto
class SearchController < ApplicationController
  # initial creation of a lucene index
  def create_index
    # our central INDEX
    index = FerretConfig::INDEX

    # get all Favorites, iterate over and index them
    favourites = Favourite.find(:all)
    for fav in favourites
      index << {:key => fav.id, :title => fav.title, :teaser => 
fav.teaser, :url => fav.link}
    end
    # don't close the index, but be sure to write it to the fs
    index.optimize()
    redirect_to(:action => 'search_form')
  end
  def get_results
     #we'll handle over the search_term to the view for following 
paginator searches
     if (params[:search])
       @search_term = params[:search][:search_term]
     else # is it a paginator search?
       @search_term = params[:search_term]
     end
     condition = 'teaser:"' + @search_term + '"'
     # we'll use the standard rails paginator
     @result_pages, @results = paginate(:result, :per_page => 5, 
:conditions => condition)
     return @result_pages, @results, @search_term
   end
end

```

---

<div class="post-metadata">

**Author:** ![tripdragon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@tripdragon](https://www.ruby-forum.com/u/tripdragon)\
**Post date:** [July 7, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/help-installing-ferret/97514/4 "2006-07-07T18:56:34Z")

</div>

here is the code zipped

> **[Hightail Spaces](https://spaces.hightail.com/resolve/ufid/1187C2BF3781C9BD)**
>
> Hightail Spaces lets you send unlimited files, of any size, to anyone. Collaborate with your team and evolve your work.

---

<div class="post-metadata">

**Author:** ![tripdragon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@tripdragon](https://www.ruby-forum.com/u/tripdragon)\
**Post date:** [July 8, 2006, 9:04am UTC](https://www.ruby-forum.com/t/help-installing-ferret/97514/5 "2006-07-08T09:04:54Z")

</div>

trip dragon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> [Peak Obsession](http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails)
> 
> I followed everything here but at the last I get when loading page  
> get\_results

try acts\_as\_ferret, it will make using ferret dead simple.

Cheers.

–  
Surendra S.  
[http://ssinghi.kreeti.com](http://ssinghi.kreeti.com), [http://www.kreeti.com](http://www.kreeti.com)  
Read my blog at: [http://cuttingtheredtape.blogspot.com/](http://cuttingtheredtape.blogspot.com/)  
,----  
| “War is Peace! Freedom is Slavery! Ignorance is Strength!”  
| – Orwell, 1984, 1948  
`----
