2010-04-02 211 views
3

由於我試圖安裝xapian但失敗了,我嘗試使用xapian-full的另一種替代方法。安裝似乎順利,但是當我嘗試與我得到再次錯誤消息烤寫代碼:xapian-full安裝在mac os x雪豹上但dlopen失敗LoadError

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 

有誰知道如何解決這個問題?

回答

0

我已經完成了這個難題,並且我發現網上的說明似乎非常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 
+0

我想這是涉及到不那麼標準的MacPorts安裝。出於某種原因,路徑選項沒有正確連接,因爲macports試圖在預期的ruby庫位置以外的地方安裝xapian ruby​​綁定。 – 2010-12-01 04:42:24

2

這個問題涉及到紅寶石,而不是圖書館本身。

我不得不嘗試安裝Xapian的福了同樣的問題,並通過這樣做

CP解決它/Library/Ruby/Gems/1.8/gems/xapian-full-1.1.3.4/xapian- core-1.1.3/.libs/*/usr/local/lib

(將RubyGems路徑替換爲安裝路徑)。

0

此問題已在https://github.com/rex1fernando/xapian-full中修復。從那裏,通過鍵入

rake 

下載更新Rake文件,並將其放置在

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

重建寶石,問題應該得到解決。

更新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