title: ln: /usr/lib/libmysqlclient.18.dylib: File exists
body: <pre><code>rake aborted!
  dlopen(/Users/ava/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
    Referenced from: /Users/ava/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
    Reason: image not found - /Users/ava/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle`
  </code></pre>
  
  <p>Ran the <a href="https://stackoverflow.com/a/6100648/602524">following</a> to resolve: </p>
  
  <pre><code>$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib \
               /usr/lib/libmysqlclient.18.dylib
  ln: /usr/lib/libmysqlclient.18.dylib: File exists
  </code></pre>
  
  <p>My setup:</p>
  
  <ul>
  <li>OSX 10.8.4</li>
  <li>MySQL 5.1.71</li>
  <li><p>libmysqlclient.16.dylib</p>
  
  <pre><code>$ locate libmysqlclient.16.dylib
  /usr/lib/libmysqlclient.16.dylib
  /usr/local/Cellar/mysql51/5.1.71/lib/mysql/libmysqlclient.16.dylib
  </code></pre></li>
  <li><p>libmysqlclient.18.dylib</p>
  
  <pre><code>$ locate libmysqlclient.18.dylib
  /usr/lib/libmysqlclient.18.dylib
  </code></pre></li>
  </ul>
  
  <p>In <code>.bash_profile</code>, I have</p>
  
  <pre><code>export PATH="/usr/local/bin:$HOME/.rvm/bin:$HOME/bin:$PATH"
  export DYLD_LIBRARY_PATH=/usr/local/bin/mysql
  </code></pre>
  
  <p>How to get this rake running? Am I supposed to have <code>libmysqlclient.18.dylib</code> under <code>/usr/local/Cellar/mysql51/5.1.71/lib/mysql</code> too? If yes, how do I create it?</p>