title: Rails + MySQL on Mavericks - Library not loaded: libmysqlclient.18.dylib
body: <p>When I run a Rails (<code>rails s</code>) app on my localhost (OSX Mavericks), I get this error </p>
  
  <pre><code>message:/Users/adam/.rvm/gems/ruby-2.0.0-p481/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `require': dlopen(/Users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
    Referenced from: /Users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle
    Reason: image not found - /Users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `&lt;top (required)&gt;'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
      from /Users/adam/rubydev/logistadvise/config/application.rb:7:in `&lt;top (required)&gt;'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in &lt;top (required)&gt;'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
      from /Users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:73:in `&lt;top (required)&gt;'
      from bin/rails:4:in `require'
      from bin/rails:4:in `&lt;main&gt;'
  </code></pre>
  
  <p>I am not sure how I already installed MySQL, but I guess it's in the subfolder called <code>Cellar</code>.</p>
  
  <p>Here's how my <code>bash_profile</code> looks like:</p>
  
  <pre><code>MYSQL=/usr/local/mysql/bin
  export PATH=$PATH:$MYSQL
  export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
  export PG_DUMP="/Applications/Postgres.app/Contents/MacOS/bin/"
  #PATH=$PG_DUMP:$PATH
  ...
  </code></pre>
  
  <p>How to solve this issue?</p>