简体   繁体   中英

thinking-sphinx + REXML error in rails 2.3.8

I'm trying to get sphinx running via thinking-sphinx , everything works fine until I go to the search page

I have the following model

class Student < ActiveRecord::Base
 define_index do
  indexes [lastname, firstname]
 end
end

and In my application controller I have include (after some web search)

include REXML

But when I go to students controller index action

def index
    @students = Student.search params[:search]
end

i'm getting the following error

undefined method `default_external' for REXML::Encoding:Module

any idea on what is happening?

my env is as follows

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/sameera/.rvm/gems/ruby-1.8.7-p357
  - RUBY EXECUTABLE: /home/sameera/.rvm/rubies/ruby-1.8.7-p357/bin/ruby
  - EXECUTABLE DIRECTORY: /home/sameera/.rvm/gems/ruby-1.8.7-p357/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/sameera/.rvm/gems/ruby-1.8.7-p357
     - /home/sameera/.rvm/gems/ruby-1.8.7-p357@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/


 Linux

 thinking-sphinx-1.4.11

rails 2.3.8

thanks in advance

I'm not entirely sure what the issue is exactly, but I think I've heard of others having issues combining Thinking Sphinx with REXML. What happens if you don't use/load REXML?

Which version of Sphinx are you trying to setup? sphinx 2 works only with Rails 3 http://freelancing-god.github.com/ts/en/rails3.html

正如Riddle Google小组上的pat所指出的那样,不包括REXML,只是要求它可以解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM