gpt4 book ai didi

ruby - OpenCV与Ruby错误

转载 作者:行者123 更新时间:2023-12-02 17:48:05 24 4
gpt4 key购买 nike

我正在使用ruby-opencv gem在ruby上使用opencv。我用Homebrew来安装opencv。 opencv和ruby的安装成功,但是尝试运行任何示例时出现以下错误-

/usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/ruby-opencv-0.0.14/opencv.bundle, 9): Library not loaded: /usr/local/lib/libpng16.16.dylib (LoadError)
Referenced from: /usr/local/lib/libopencv_highgui.2.4.dylib
Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 34.0.0 or later, but libpng16.16.dylib provides version 33.0.0 - /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/ruby-opencv-0.0.14/opencv.bundle
from /usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/ruby-opencv-0.0.14/lib/opencv.rb:11:in `<top (required)>'
from /usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from /usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from opencv.rb:1:in `<main>'

我该如何解决?

最佳答案

如您在错误消息中看到的(此处:requires version 34.0.0 or later, but libpng16.16.dylib provides version 33.0.0),OpenCV需要版本34.00或更高版本中的libpng(并且您拥有33.0.0),因此您需要安装此lib的较新版本。如果简单的brew install libpng无法解决问题,请尝试将其卸载,然后使用this solution重新安装。

关于ruby - OpenCV与Ruby错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30322312/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com