【问题标题】:xapian-full installed on mac os x snow leopard but failed with dlopen LoadErrorxapian-full 安装在 mac os x snow leopard 上,但因 dlopen LoadError 而失败
【发布时间】:2010-04-02 05:06:47
【问题描述】:

由于我尝试安装 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

有人知道怎么解决吗?

【问题讨论】:

    标签: ruby macos rubygems osx-snow-leopard xapian


    【解决方案1】:

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

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

    也许这对你有用,对我也有用。结帐自制软件,尤其是http://github.com/mxcl/homebrew/blob/master/Library/Formula/xapian.rb

    【讨论】:

      【解决方案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 路径替换为您的安装路径)。

      【讨论】:

        【解决方案3】:

        我已经尽力做到了这一点,并且我发现网络上的说明似乎非常特定于操作系统和 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
        

        【讨论】:

        • 我认为这与不那么标准的 macports 安装有关。由于某种原因,路径选项未正确连接,因为 macports 尝试将 xapian ruby​​ 绑定安装在预期的 ruby​​ 库位置以外的其他位置。
        【解决方案4】:

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

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

        通过键入重建 gem

        rake
        

        问题应该解决了。

        更新rex1fernandohttp://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
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2010-11-30
          • 1970-01-01
          • 1970-01-01
          • 2012-10-17
          • 2014-09-19
          • 1970-01-01
          • 2013-01-16
          • 2011-12-23
          相关资源
          最近更新 更多