I haven't tried the library myself yet but
https://github.com/jeffrafter/ruby-opencv
has a short example code section on face recognition - although I think this is the source used for the RubyGem OpenCV (or at least a fork of the original), neither has been under development for quite a few years.
http://rubygems.org/gems/opencv
gem "opencv", "~> 0.0.7"
if you need more up-to-date features maybe try
https://github.com/amarburg/opencv-ffi
Although you will need to import the modules into your public folders (or whichever folder you are using to import external code from - it varies with Rails version), and then follow the example code.