jab
jab

Reputation: 5823

Rails Typhoeus Curl Trouble

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.

Upvotes: 3

Views: 4679

Answers (3)

TT--
TT--

Reputation: 3205

I tried adding libcurl-devel 7.57.0-1 to msys2 (on Windows) but it didn't help. (pacman -Ss libcurl showed it as installed:

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

So for anyone having the same problem on Windows, an easy way to get around the LoadError: Could not open library 'libcurl' is to:

Related questions about the same problem:

Upvotes: 0

Gajendra Jena
Gajendra Jena

Reputation: 530

sudo apt-get install libcurl4-openssl-dev worked for me.

Upvotes: 3

deltheil
deltheil

Reputation: 16121

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'

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).

Upvotes: 8

Related Questions