I created Ruby class SolrCellRequest and saved it to
/path/to/resume/vendor/plugins/acts_as_solr/lib  directory.

Here is code original from the tutorial.

module ActsAsSolr
  class SolrCellRequest < Solr::Request::Select
    def initialize(doc,file_name)
     .....
     .....
  def handler
      'update/extract'
    end
  end

  class SolrCellResponse < Solr::Response::Ruby
  end

end

however when I start using it
$ script/console
Loading development environment (Rails 2.2.2)
>> solr = Solr::Connection.new("http://localhost:8982/solr";)
>> req = SolrCellRequest.new(Solr::Document.new(:id=>1), '/path/to/resume.pdf')

I got this error

> req = SolrCellRequest.new(Solr::Document.new(:id=>1), 
> '/Users/tcdoan/eric.pdf')
LoadError: Expected
/Users/tcdoan/resume/vendor/plugins/acts_as_solr/lib/solr_cell_request.rb
to define SolrCellRequest
        from 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:426:in
`load_missing_constant'
        from 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in
`const_missing'
        from 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in
`const_missing'
        from (irb):2

Can you tell what was wrong here. Thanks.

Thanh


On Wed, May 13, 2009 at 6:11 PM, Thanh Doan <tcd...@gmail.com> wrote:
> Hi Erik et all,
>
> I am following this  tutorial link
> http://www.lucidimagination.com/blog/tag/acts_as_solr/
>
> to play with acts_as_solr and see if we can invoke solr cell right
> from our Rails app.
>
> following he tutorial i created  class    c  but dont
> know where to save the solr_cell_request.rb file to.
>
> Should I save file solr_cell_request.rb to
> /path/to/resume/vendor/plugins/acts_as_solr/lib  directory
> or
> I have to save it to
> /path/to/resume/vendor/plugins/acts_as_solr/lib/solr/request directory
> where the Solr::Request::Select class locate?
>
> Thanks!
>
> Thanh Doan
>



-- 
Regards,
Thanh Doan
713-884-0576
http://datamatter.blogspot.com/

Reply via email to