title: Building Ruby and specifying OpenSSL directory
body: <p>I'm using an old version of ubuntu 10.04 which is no longer maintained. The payment system I'm using has recently updated its SST/TLS certificates and now require <code>openssl &gt; 1.0.0</code>. </p>
  
  <p>I've downloaded the latest version and built it from scratch using the following commands:</p>
  
  <pre><code>CFLAGS=-fPIC ./config shared
  CFLAGS='$CFLAGS -fPIC -Wl -Bsymbolic' CXXFLAGS='$CXXFLAGS -fPIC -Wl -Bsymbolic' make
  make test
  make install
  </code></pre>
  
  <p>After running <code>make install</code> it has put all the files under <code>/usr/local/ssl</code>. I've then added new path to <code>/etc/environment</code> to make OS find new version of openssl before the system's one.</p>
  
  <p>I've installed rbenv and ruby-build plugin for it to build ruby from scratch pointing to the newly compiled openssl library. However ruby won't use that specified version and use system's version instead. Running <code>ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'</code> reports i'm still using <code>0.9.8k</code> version. The command used for compiling ruby is as follows: </p>
  
  <pre><code>CFLAGS="$CFLAGS -fPIC" RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/ssl" rbenv install ree-1.8.7-2012.02
  </code></pre>
  
  <p>I've looked through compiler logs and it seems ruby-build is using the specified path for ssl. </p>
  
  <p>I've also tried upgrading the operating system but that didn't help since 10.04 and 12.04 have diverged greatly and I had a lot of conflicts in config files.</p>
  
  <p>So the question is how can I compile openssl and ruby so that ruby uses the specified openssl binaries and headers during its compilation?</p>