【问题标题】:Rails Typhoeus Curl TroubleRails Typhoeus 卷曲问题
【发布时间】:2012-09-24 04:41:38
【问题描述】:

我对这个错误摸不着头脑,因为类似的错误是指从源代码编译 libcurl 的实例;但是,我只是想在我的 Ubuntu 12.04 上运行以前的 rails 项目。

Exception Trace from Running Rails Application Server


/var/lib/gems/1.9.1/gems/ffi-1.1.1/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'libcurl': libcurl: cannot open shared object file: No such file or directory. (LoadError)
Could not open library 'libcurl.so': libcurl.so: cannot open shared object file: No such file or directory
    from /var/lib/gems/1.9.1/gems/ffi-1.1.1/lib/ffi/library.rb:88:in `map'
    from /var/lib/gems/1.9.1/gems/ffi-1.1.1/lib/ffi/library.rb:88:in `ffi_lib'
    from /var/lib/gems/1.9.1/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:405:in `<module:Curl>'
    from /var/lib/gems/1.9.1/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:6:in `<module:Typhoeus>'
    from /var/lib/gems/1.9.1/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:5:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /var/lib/gems/1.9.1/gems/typhoeus-0.4.2/lib/typhoeus.rb:5:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /var/lib/gems/1.9.1/gems/panda-1.5.0/lib/panda/adapters/faraday.rb:2:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /var/lib/gems/1.9.1/gems/panda-1.5.0/lib/panda.rb:19:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
    from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
    from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'
    from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
    from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
    from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'

感谢任何帮助或评论。

【问题讨论】:

    标签: ruby-on-rails ruby ubuntu curl libcurl


    【解决方案1】:

    我尝试将 libcurl-devel 7.57.0-1 添加到 msys2(在 Windows 上),但没有帮助。 (pacman -Ss libcurl 显示已安装:

    msys/libcurl 7.57.0-1 (libraries) [installed]
    Multi-protocol file transfer library (runtime)
    msys/libcurl-devel 7.57.0-1 (development) [installed]
    Libcurl headers and libraries
    

    因此,对于在 Windows 上遇到相同问题的任何人,绕过LoadError: Could not open library 'libcurl' 的简单方法是:

    关于同一问题的相关问题:

    【讨论】:

      【解决方案2】:

      sudo apt-get install libcurl4-openssl-dev 为我工作。

      【讨论】:

        【解决方案3】:

        是否正确安装了 libcurl? Typhoeus 没有原生扩展,但它需要 libcurl 动态库 (.so),因为它与 FFI library 一起使用:

        # from lib/typhoeus/curl.rb
        ffi_lib 'libcurl'
        

        我会说不需要开发文件(头文件),所以sudo apt-get install libcurl3 应该可以解决问题(否则通过sudo apt-get install libcurl4-openssl-dev 安装支持 SSL 的开发版本)。

        【讨论】:

        • 我在使用 Graphiti 时遇到了问题,但安装 libcurl4-openssl-dev 也能解决问题....!!非常感谢
        • 同样的问题,同样的解决方案:)
        猜你喜欢
        • 2016-02-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-02-07
        • 2011-03-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多