Updating xapian_db and xapian-ruby going wrong badly

26 views
Skip to first unread message

Mika Mustalahti

unread,
Aug 20, 2013, 9:54:05 AM8/20/13
to xapi...@googlegroups.com

Hi,

I'm trying to update my xapian_db
(1.2.4.4) and xapian-ruby (1.2.12) gems to the current versions (1.3.5.1) and (1.2.15.1) by doing "bundle update xapian-ruby" and "bundle update xapian_db". But something has gone terribly wrong as my application doesn't currently boot at all.

When I boot the application with "rvmsudo rails server -p 80" (I need it to run in port 80 even in development) I get an error message:
"/home/mika/.rvm/gems/ruby-1.9.3-p194/gems/xapian_db-1.3.5.1/lib/xapian_db/railtie.rb:57:in `block (2 levels) in <class:Railtie>': undefined method `each' for nil:NilClass (NoMethodError)"

That is where xapian_db is doing this: @disabled_query_flags.each { |flag| config.disable_query_flag flag }

My config/xapian_db.rb

-----------------------
# XapianDb configuration
defaults: &defaults
adapter: active_record
language: fi
term_min_length: 2
enabled_query_flags: FLAG_PHRASE
disabled_query_flags: FLAG_SPELLING_CORRECTION

development:
database: db/xapian_db/development
<<: *defaults

test:
database: ":memory:" # Use an in memory database for tests
<<: *defaults

production:
database: db/xapian_db/production
<<: *defaults

-----------------------

I have tried to remove xapian_db and xapian-ruby with "bundle exec gem uninstall xapian-ruby xapian_db" and then I removed the db/xapian_db/ directory and the config/xapian_db.rb file. After this I installed them again with "bundle install".

I'm very grateful for any help.

Gernot

unread,
Aug 20, 2013, 10:42:06 AM8/20/13
to xapi...@googlegroups.com
Hi Mika

Your config file is named wrong, it seems. xapian_db is looking for xapian_db.yml, not xapian_db.rb. And you should not mix enabled and disabled query flags. If you declare enabled query flags, you MUST enumerate all flags you want to use. Did that help? If not, please give me some more info about your application setup (rails version, gems...)

Gernot

Mika Mustalahti

unread,
Aug 20, 2013, 4:11:54 PM8/20/13
to xapi...@googlegroups.com
Hi Gernot

Ahh. Thank you. Now it works. I have an other question also so I'll open new thread for it.

-Mika
Reply all
Reply to author
Forward
0 new messages