Cannot use openssl, undefined symbol: d2i_ECPKParameter

I have this undefined symbol d2i_ECPKParameters I have already compiled and installed openssl

irb(main):001:0> require 'openssl' LoadError: /usr/local/lib/ruby/site_ruby/1.8/i686-linux/openssl.so: undefined symbol: d2i_ECPKParameters - /usr/local/lib/ruby/site_ruby/ 1.8/i686-linux/openssl.so   from /usr/local/lib/ruby/site_ruby/1.8/i686-linux/openssl.so   from /usr/local/lib/ruby/site_ruby/1.8/openssl.rb:17   from (irb):1:in `require'   from (irb):1

I have the same problem on REHL and Ruby 1.9.1. Anyone know whats going on as I'm stuck.