acts_as_ferret

I started using the acts_as_ferret plugin for ruby on rails today. I had a a few issues, so here is how I solved them.

  1. script/plugin install svn://projects.jkraemer.net/acts_as_ferret/tags/plugin/stable/acts_as_ferret does not work! – After successfully installing ferret using the gem, I tried to download the plugin, but my box could not connect. I am not sure if it is an error with my setup or what. So I had to browse the source tree in track and copy and past the files on my box.
  2. Rails will not start – After I copied across the plugin, Rails was complaining that it could not find the plugin acts_as_ferret. It turned out that the plugin directory I had made was not world readable, so rails could not read it. A quick chmod fixed that
  3. Site was not getting indexed – After putting the acts_as_ferret in the desired models, I searched for words that I knew existed and i was not getting any responses. I figured out that it was not being indexed. if the index directory does not exist than the plugin calls rebuild_index method. This is supposed to go through your database and create the index. The app was failing executing the rebuild_index method. I googled the error and came across this post It was an error because i was using Unicode. So I added the following to my environment.rb file and it has indexed the files :

ENV['LANG'] = ‘en_GB.UTF-8′

ENV['LC_TIME'] = ‘C’

All I have to do now is figure out how to use ferret :)

Hamza

3 comments so far

  1. divotdave on

    Under item #1 – You need to have Subversion installed on your box in order for that link to work.

  2. Hamza on

    Thanks for the comment. I do have subversion installed.

    I realised later that my firewall was blocking the port.

    Thanks anyway!

    Hamza

  3. tovorinok on

    Hello

    Great book. I just want to say what a fantastic thing you are doing! Good luck!

    G’night


Leave a reply