D-Alex / ropencv

ffi ruby wrapper for opencv
Other
67 stars 14 forks source link

Could not open library 'rbind_opencv' #1

Closed mmun closed 11 years ago

mmun commented 11 years ago

Hi! This is a very cool project. I'm having trouble getting started. I'm running into this error when I try to require 'ropencv'.


/home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ffi-1.9.0/lib/ffi/library.rb:123:in `block in ffi_lib': Could not open library 'rbind_opencv': rbind_opencv: cannot open shared object file: No such file or directory. (LoadError)
Could not open library 'librbind_opencv.so': librbind_opencv.so: cannot open shared object file: No such file or directory.
Could not open library '/home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ropencv-0.0.7/lib/lib/librbind_opencv.so': libopencv_calib3d.so.2.9: cannot open shared object file: No such file or directory
    from /home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ffi-1.9.0/lib/ffi/library.rb:90:in `map'
    from /home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ffi-1.9.0/lib/ffi/library.rb:90:in `ffi_lib'
    from /home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ropencv-0.0.7/lib/ruby/ropencv/ropencv.rb:18:in `<module:Rbind>'
    from /home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ropencv-0.0.7/lib/ruby/ropencv/ropencv.rb:7:in `<module:OpenCV>'
    from /home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ropencv-0.0.7/lib/ruby/ropencv/ropencv.rb:5:in `<top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ropencv-0.0.7/lib/ruby/ropencv.rb:1:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/ropencv-0.0.7/lib/ruby/ropencv.rb:1:in `<top (required)>'
    from ropencv_test.rb:4:in `require'
    from ropencv_test.rb:4:in `<main>'
D-Alex commented 11 years ago

Hi,

I guess, the install folder of the opencv libraries you have used to build ropencv are not part of your LD_LIBRARY_PATH environment. Therefore, the opencv libraries cannot be found during run time.

Usually, opencv is installing its libraries into /usr/local/lib. Try to call export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH from the command line before starting ruby from the same command line.

I hope this helps Alex

mmun commented 11 years ago

Thank you. It works now! :beers: