August 18th, 2008 Add Your Comments

Here is my setup:

Note: I put my custom libraries in ~/opt.
  • Step 1: Download

    Download xapian-core and xapian-binding from www.xapian.org to ~/opt/src. Untar the files.

  • Step 3: Install xapian-core

    $ cd ~/src/xapian-core directory.

    $ ./configure –prefix=$HOME/opt

    $ make

    $ make install

  • Step 4: Install xapian-bindings

    $ mkdir ~/opt/my_ruby_modules

    $ cd ~/src/xapian-bindings

    $ ./configure –with-ruby
    –prefix=$HOME/opt RUBY_LIB=$HOME/opt/my_ruby_modules RUBY_LIB_ARCH=$HOME/opt/my_ruby_modules
    $ make

    $ make install

  • Step 5: Configure your Rails site to use your modules

    In config/environment.rb:

    if RAILS_ENV == ‘production’

    config.load_paths += [ ENV['HOME'] + ‘/opt/my_ruby_modules’ ]

    end

  • Note: When you run your xapian rake tasks you’ll incorrectly get this message, “acts_as_xapian: No Ruby bindings for Xapian installed” but everything works fine.