title: _mysql_init not found when using DataMapper
body: <p>I have a simple MySQL table:</p>
  
  <pre><code>% mysql -u rampion dev -e 'describe person'
  +-------+--------------+------+-----+---------+----------------+
  | Field | Type         | Null | Key | Default | Extra          |
  +-------+--------------+------+-----+---------+----------------+
  | id    | int(11)      | NO   | UNI | NULL    | auto_increment |
  | uid   | varchar(256) | NO   | PRI | NULL    |                |
  +-------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>And a simple DataMapper script I want to run:</p>
  
  <pre><code># temp.rb
  require 'rubygems'
  require 'datamapper'
  
  DataMapper::Logger.new($stdout, :debug)
  DataMapper.setup(:default, "mysql://rampion@localhost/dev")
  
  class Person
    include DataMapper::Resource
    property :id,     Serial
    property :uid,    String
  end
  
  DataMapper.finalize
  
  p Person.first_or_create(:uid =&gt; 'Steve')
  </code></pre>
  
  <p>But when I run it, I get dynamic linker errors:</p>
  
  <pre><code>% ruby temp.rb
  ~/.rvm/gems/ruby-1.8.7-p334/gems/dm-validations-1.0.2/lib/dm-validations.rb:33: warning: already initialized constant OrderedHash
  DataObjects::URI.new with arguments is deprecated, use a Hash of URI components (~/.rvm/gems/ruby-1.8.7-p334/gems/dm-do-adapter-1.0.2/lib/dm-do-adapter/adapter.rb:215:in `new') 
  dyld: lazy symbol binding failed: Symbol not found: _mysql_init
    Referenced from: ~/.rvm/gems/ruby-1.8.7-p334/gems/do_mysql-0.10.12/lib/do_mysql/do_mysql.bundle
    Expected in: flat namespace
  
  dyld: Symbol not found: _mysql_init
    Referenced from: ~/.rvm/gems/ruby-1.8.7-p334/gems/do_mysql-0.10.12/lib/do_mysql/do_mysql.bundle
    Expected in: flat namespace
  
  zsh: trace trap  ruby temp.rb
  </code></pre>
  
  <p>I have <code>LD_LIBRARY_PATH</code> set to <code>/usr/local/mysql/lib</code>, which is where I have MySQL installed, and it seems to have <code>_mysql_init</code> defined in there:</p>
  
  <pre><code>% grep '_mysql_init' $LD_LIBRARY_PATH/libmysqlclient.18.dylib
  Binary file /usr/local/mysql/lib/libmysqlclient.18.dylib matches
  </code></pre>
  
  <p>I have no idea what I need to do to fix this.</p>