Rubyのopencvをインストールしたいです。(環境構築して実行できる環境を作りたい。)
参考にした記事
string
11 OpenCVをインストール
opencv
こちらにアクセスしてOpenCVをインストールしました。
(アクセスするとexeファイルがダウンロードされた。)
次・・・
string
1OpenCVのdllが格納されたフォルダにパスを通す(例えばOpenCVをC:\opencvにインストールした場合、mswin32ならC:\opencv\build\x86\vc10\bin, mingw32ならC:\opencv\build\x86\mingw\binにパスを通してください)
さきほどダウンロードしたexeファイルを実行したのですが
exeファイルを実行すると上記のような画面が出てきたので
(ファイルをどこに置くか聞かれているのかと思いdesktopを選択)
とにかくDesktopにファイルを配置しました。
ここでパスを通そうとしたのですが
ruby
1C:\opencv\build\x86\vc10\bin 2 3C:\opencv\build\x86\mingw\bin
両方試したのですが指定したパスは存在しないと出ます。
そこで、パスを通したい・・・参考記事
以下のような方法でパスを通そうとしました。
ruby
1$ set PATH=%PATH%;C:\desktop\opencv\build\x86\vc10\bin 2$ set PATH=%PATH%;C:\desktop\opencv\build\x86\mingw\bin
(結果的にだめだった)
次、・・・
string
1以下のコマンドでruby-opencvをインストール 2$ gem install ruby-opencv
↓
ruby
1Temporarily enhancing PATH for MSYS/MINGW... 2Building native extensions. This could take a while... 3ERROR: Error installing ruby-opencv: 4 ERROR: Failed to build gem native extension. 5 6 current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-opencv-0.0.18/ext/opencv 7C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20190824-62012-1r12vwu.rb extconf.rb 8*** extconf.rb failed *** 9Could not create Makefile due to some reason, probably lack of necessary 10libraries and/or headers. Check the mkmf.log file for more details. You may 11need configuration options. 12 13Provided configuration options: 14 --with-opt-dir 15 --without-opt-dir 16 --with-opt-include 17 --without-opt-include=${opt-dir}/include 18 --with-opt-lib 19 --without-opt-lib=${opt-dir}/lib 20 --with-make-prog 21 --without-make-prog 22 --srcdir=. 23 --curdir 24 --ruby=C:/Ruby24-x64/bin/$(RUBY_BASE_NAME) 25 --with-opencv-dir 26 --without-opencv-dir 27 --with-opencv-include 28 --without-opencv-include=${opencv-dir}/include 29 --with-opencv-lib 30 --without-opencv-lib=${opencv-dir}/lib 31 --with-libxml2-dir 32 --without-libxml2-dir 33 --with-libxml2-include 34 --without-libxml2-include=${libxml2-dir}/include 35 --with-libxml2-lib 36 --without-libxml2-lib=${libxml2-dir}/lib 37extconf.rb:16:in `initialize': No such file or directory @ rb_sysopen - /usr/local/include/opencv2/core/version.hpp (Errno::ENOENT) 38 from extconf.rb:16:in `open' 39 from extconf.rb:16:in `cv_version_suffix' 40 from extconf.rb:46:in `<main>' 41>> Check the required libraries... 42 43extconf failed, exit code 1 44 45Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-opencv-0.0.18 for inspection. 46Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/ruby-opencv-0.0.18/gem_make.out
何が原因なんでしょうか?
分からないので参考になるリンクまたは説明をお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/24 09:32
2019/08/24 09:33
2019/08/24 09:35
2019/08/24 09:38
2019/08/24 23:18