# Install ruby-opencv with RubyInstaller on Windows
This document shows how to install ruby-opencv with RubyInstaller on Windows.
Official OpenCV binary for MinGW32 is no longer distributed, so when you use ruby-opencv with RubyInstaller, you should build OpenCV yourself using Devkit.
## Requirement
- Windows 10 64bit
- [Ruby 2.3.0p0 x64-mingw32 on RubyInstaller](http://rubyinstaller.org/)
In this document, I assume that the Devkit is installed to ```D:/local/devkit```, the OpenCV library is extracted to ```D:/work/opencv-2.4.13``` and its source directory is ```D:/work/opencv-2.4.13/sources```, and the output will be installed in ```D:/opencv-2.4.13```.
Note that ```D:\>``` is a prompt of ```cmd.exe```, so you should not input it.
Note that the paths ```%OPENCV_INSTALL_PATH%\x64\mingw\bin``` and ```%DEVKIT_PATH%\mingw\bin``` must **ALWAYS** be set when using ```ruby-opencv```, or you may get the following error.
```
D:\>irb
irb(main):001:0> require 'opencv'
LoadError: 126: The specified module could not be found. - D:/local/ruby/lib/ruby/gems/2.3.0/gems/ruby-opencv-0.0.17/lib/opencv.so
from D:/local/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from D:/local/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from D:/local/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from D:/local/ruby/lib/ruby/gems/2.3.0/gems/ruby-opencv-0.0.17/lib/opencv.rb:8:in `rescue in <top(required)>'
from D:/local/ruby/lib/ruby/gems/2.3.0/gems/ruby-opencv-0.0.17/lib/opencv.rb:5:in `<top(required)>'
from D:/local/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from D:/local/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from D:/local/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'