views:

275

answers:

2

Since I have tried to install xapian but failed, I try another alternative with xapian-full. Installation seems goes well, but when I try to write code with that I got toasted with error message again:

irb(main):001:0> require 'xapian'
LoadError: dlopen(/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/xapian-full-1.1.3.4/lib/_xapian.bundle, 9): Library not loaded: /usr/local/lib/libxapian-1.1.3.dylib
  Referenced from: /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/xapian-full-1.1.3.4/lib/_xapian.bundle
  Reason: image not found - /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/xapian-full-1.1.3.4/lib/_xapian.bundle
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/xapian-full-1.1.3.4/lib/_xapian.bundle
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/xapian.rb:40
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from (irb):1

Anyone know how to solve this?

+1  A: 

by far the easiest way to install xapian on OSX is

sudo brew install xapian --python --ruby #etc

maybe this will work for you as nicely as it has worked for me. checkout homebrew, http://github.com/mxcl/homebrew/blob/master/Library/Formula/xapian.rb in particular.

skyl
A: 

I've done this the hard way, and I've found that the instructions out on the web seem to be very OS- and Xapian-version specific (hence the motivation for using brew when you can).

However, if you're looking for how to set it up yourself, here are my latest instructions, built successfully just this morning, using Xapian v1.2.3 (the latest stable build at the time of this writing), on a brand-new install of OS X 10.6.4 (Snow Leopard).

Make sure you have XCode installed first. It includes compiler tools that you'll need.

References: http://www.telos.co.nz/2009/09/install-xapian-on-mac-os-x-10-6/ http://locomotivation.squeejee.com/post/109279130/simple-ruby-on-rails-full-text-search-using-xapian

[DOWNLOAD and EXPAND]
Download the CORE and BINDINGS files from the address below. File names should be similar to the following, while the version number may vary:
  xapian-core-1.2.3.tar.gz and
  xapian-bindings-1.2.3.tar.gz
From:
  http://xapian.org/download

Open up a terminal window and cd into the directory where you saved the .tar files
Run these commands to expand the .tar files  
  tar zxvf xapian-core-<version>.tar.gz
  tar zxvf xapian-bindings-<version>.tar.gz

[BUILD and INSTALL]  
  cd xapian-core-<version>
  ./configure --prefix=/opt
  make
  !!! the "make" command MUST exit with zero errors, or you'll need to try again !!!
  sudo make install

  cd xapian-bindings-<version>
  ./configure XAPIAN_CONFIG=/opt/bin/xapian-config
  make
  sudo make install
normalocity