installing dependencies (on ubuntu) Make sure equivalents exist on OSX if the later steps fail
sudo apt-get update
sudo apt-get install git-core subversion cmake build-essential libgtk2.0-dev libjpeg-dev pkg-config libpq-dev libopenssl-ruby
setting up opencv
$ git clone git://github.com/Itseez/opencv.git
$ cd opencv #or whatever you cloned the directory down to
$ mkdir release && cd release
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make && sudo make install && sudo ldconfig
$ gem install opencv
This should now work! I HIGHLY recommend that you stick with 64 bit everything (ruby, linux, opencv, etc). Also, this is for x86 (64 bit as oppose to arm. I do not vouch for this working on arm).