我已经遵循了这个问题的所有步骤:Highgui and ruby
opencv 是通过 brew 安装的,而 rb_webcam 是通过 gem install 安装的。
require "opencv"
require "rb_webcam"
capture = Webcam.new
错误是:
/Users/swills/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/nice-ffi-0.4/lib/nice-ffi/library.rb:98:in `load_library': Could not load highgui. (LoadError)
from /Users/swills/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/rb_webcam-0.3.0/lib/rb_webcam.rb:7:in `<module:Highgui>'
from /Users/swills/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/rb_webcam-0.3.0/lib/rb_webcam.rb:4:in `<top (required)>'
from /Users/swills/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /Users/swills/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /Users/swills/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from gem_testing.rb:3:in `<main>'
在上面的另一个stackoverflow帖子中,用户发帖说他们-
“通过从这里下载 gem 解决它https://github.com/TyounanMOTI/rb_webcam并手动构建和安装它。”
我的问题是,如何通过手动构建和安装来解决它?
(特别是如果不考虑手动安装“gem install rb_webcam”)。