3

由于我尝试安装 xapian 但失败,我尝试使用 xapian-full 的另一种替代方法。安装似乎很顺利,但是当我尝试使用它编写代码时,我再次收到错误消息:

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

有谁知道如何解决这个问题?

4

4 回答 4

6

到目前为止,在 OSX 上安装 xapian 的最简单方法是

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

也许这对你有用,就像它对我有用一样。结帐自制软件,特别是http://github.com/mxcl/homebrew/blob/master/Library/Formula/xapian.rb

于 2010-07-17T18:26:55.117 回答
2

这个问题与 Ruby gem 相关,而不是库本身。

我在尝试安装 xapian-fu 时遇到了同样的问题,并通过这样做解决了它

cp /Library/Ruby/Gems/1.8/gems/xapian-full-1.1.3.4/xapian-core-1.1.3/.libs/* /usr/local/lib

(用您的安装路径替换 RubyGems 路径)。

于 2010-11-30T12:21:44.027 回答
0

此问题已在https://github.com/rex1fernando/xapian-full中修复。从那里,下载更新的Rakefile并将其放入

~/.gem/gems/xapian-full-1.1.3.4

通过键入重建 gem

rake

问题应该得到解决。

更新rex1fernando在http://masanjin.net/sup-bugs/msg323推荐了一个更好的程序:

git clone git://github.com/rex1fernando/xapian-full.git
cd xapian-full
(sudo) gem uninstall xapian-full
gem build xapian-full.gemspec
(sudo) gem install --local xapian-full
于 2010-12-14T18:47:18.830 回答
0

我已经很艰难地做到了这一点,并且我发现网络上的说明似乎非常特定于操作系统和 Xapian 版本(因此,尽可能使用 brew 的动机)。

但是,如果您正在寻找如何自己设置它,这里是我最新的说明,今天早上成功构建,使用 Xapian v1.2.3(撰写本文时最新的稳定版本),在一个全新的安装 OS X 10.6.4 (Snow Leopard)。

确保首先安装了 XCode。它包括您需要的编译器工具。

参考资料: http ://www.telos.co.nz/2009/09/install-xapian-on-mac-os-x-10-6/ http://lomotivation.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
于 2010-10-07T16:13:37.323 回答