title: psqlodbc driver not found on heroku despite being in my app directory
body: <p>I am trying to get RODBC to work on heroku. I have a rails app that calls an R script from RinRuby, which then queries the production database in order to do some analysis. It all works fine on my local Mac, so I thought the best approach was to use the binary compiled on my Max (<code>psqlodbcw.so</code>) into my repo, and reference it in production as well. Unfortunately, when I try to make the connection in production using this connection string:</p>
  <pre><code>&gt; library(RODBC)
  &gt; dbhandle &lt;- odbcDriverConnect('driver=./psqlodbcw.so;database=nw_server_production;trusted_connection=true;uid=nw_server')
  Warning messages:
  1: In odbcDriverConnect(&quot;driver=./psqlodbcw.so;database=&lt;db_name&gt;;trusted_connection=true;uid=&lt;user&gt;&quot;) :
    [RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib './psqlodbcw.so' : file not found
  2: In odbcDriverConnect(&quot;driver=./psqlodbcw.so;database=&lt;db_name&gt;;trusted_connection=true;uid=&lt;user&gt;?&quot;) :
    ODBC connection failed
  </code></pre>
  <p>I have seen this error in a similar post online <a href="https://stackoverflow.com/questions/59306332/python-cant-find-odbc-driver-on-heroku-after-setting-everything">here</a>, but using SQL server instead of postgres. But the accepted answer on that post doesn't explain why the file isn't found, despite being in the app directory. I did follow the same approach and made my own custom buildpack (available here: <a href="https://github.com/NovaWulf/r-rodbc-buildpack" rel="nofollow noreferrer">https://github.com/NovaWulf/r-rodbc-buildpack</a>). I replaced the .so file with the one I compiled on my mac, and simply deleted the .rll file and the code that copies it, since I don't have that file (and hopefully don't need it for psqlodbc?). When I run that buildpack it runs without error on heroku, but then when I reference the .so file copied from the buildpack, I get the same &quot;file not found&quot; error.</p>
  <p>Is this happening because the .so file was compiled on the wrong system architecture? I tried compiling psqlodbc on linux, but I do not get a psqlodbcq.so file when I do that (let alone an <code>.rll</code> file). The closest thing I get is a file called <code>libodbcpsqlS.so</code>, which is a setup file, not a driver file.</p>
  <p>Could someone please help me understand the best approach to this problem? Why is heroku not seeing the file that is not there? And what is the best solution? Is there a simple way to just download the correct driver file somewhere?</p>
  <p>Any help is much appreciated!</p>
  <p>Best,</p>
  <p>Paul</p>