nil.columns error in textsearch

Hi, I'm trying the text search from the rails wiki
(http://wiki.rubyonrails.org/rails/pages/TextSearch) but keep getting
this error. any ideas?

You have a nil object when you didn't expect it!
The error occured while evaluating nil.columns

...

#{RAILS_ROOT}/lib/search.rb:41:in `searchable_fields'
#{RAILS_ROOT}/lib/search.rb:64:in `searchable_fields_in_associations'
#{RAILS_ROOT}/lib/search.rb:59:in `searchable_fields_in_associations'
#{RAILS_ROOT}/lib/search.rb:50:in `searchable_fields'
#{RAILS_ROOT}/lib/search.rb:95:in `search'
#{RAILS_ROOT}/app/views/castle/index.rhtml:109:in
`_run_rhtml_castle_index'