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 /ライブラリ/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

入力して宝石を再構築する

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

私はこれを難しい方法で行いました.Web上の指示はOSおよび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://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
于 2010-10-07T16:13:37.323 に答える