本文介绍了Rails Typhoeus卷曲故障的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为这个错误而努力,因为类似的错误是指从源代码编译libcurl的实例.但是,我只是想让我的Ubuntu 12.04上运行一个以前的Rails项目.

I'm scratching my head on this error since similar errors refer to instances of compiling libcurl from source; however, I am just simply trying to get a former rails project running on my Ubuntu 12.04.

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'

任何帮助或评论都将受到赞赏.

Any help or commentary is appreciated.

推荐答案

libcurl是否已正确安装? Typhoeus没有本机扩展,但是它需要libcurl动态库(.so),因为它可以与 FFI库一起使用:

Is libcurl properly installed? Typhoeus has no native extensions but it requires libcurl dynamic library (.so) since it works with the FFI library:

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

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

I would say that the development files (headers) are not needed so sudo apt-get install libcurl3 should do the trick (otherwise install the devel version w/ SSL support via sudo apt-get install libcurl4-openssl-dev).

这篇关于Rails Typhoeus卷曲故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 12:15