<p>I'm having trouble getting a rails app on Dreamhost's Passenger to see compiled libraries in my ~/opt/lib directory.  I have to put them here because I don't have root access.  </p>

<p>I can boot up my app in ./script/console and it sees them libraries just fine because I updated my .bash_profile's <code>LD_LIBRARY_PATH</code> environment variable to include ~/opt/lib.</p>

<p>I've tried putting <code>ENV['LD_LIBRARY_PATH'] = '~/opt/lib'</code> in my environment.rb file but it doesn't seem too help.  I get the following error from Passenger when I navigate to my site:
libodbcinst.so.1: cannot open shared object file: No such file or directory - /home/username/opt/lib/odbc.so</p>

<p>Anyone have experience with this?</p>

<p>Thanks</p>

I had similar issue with Passenger that I described in
http://blog.rayapps.com/2008/05/21/using-mod_rails-with-rails-applications-on-oracle/
But in your case this migth not work as you will not be able to change Dreamhost's httpd.conf file.
Other thing that you can try is to set LD_LIBRARY_PATH in .bashrc - according to
http://www.wavethenavel.com/jonathanpenn/2008/09/08/bootstrapping-a-dreamhost-account-for-rails-and-git/
this has worked in Dreamhost's case. Have not verified that Passenger will execute .bashrc before launching ruby.