title: "Please install the mysql2 adapter"
body: <p>I am attempting to follow this <a href="http://www.redmine.org/projects/redmine/wiki/RedmineInstallOSX" rel="nofollow">Redmine setup tutorial</a>. When I get to the point of starting the server, I type <code>sudo rails server</code> and I get the following error:</p>
  
  <pre><code>Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.) (LoadError)
  </code></pre>
  
  <p>The relevent section of my Gemfile reads:</p>
  
  <pre><code>....
  if File.exist?(database_file)
  database_config = YAML::load(ERB.new(IO.read(database_file)).result)
  adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
  if adapters.any?
    adapters.each do |adapter|
      case adapter
      when /mysql/
        gem "mysql", "~&gt; 2.8.1", :platforms =&gt; [:mri_18, :mingw_18]
        gem "mysql2", "~&gt; 0.3.11", :platforms =&gt; [:mri_19, :mingw_19]
        gem "activerecord-jdbcmysql-adapter", :platforms =&gt; :jruby
  ...
  </code></pre>
  
  <p>and Gemfile.lock contains mysql2:</p>
  
  <pre><code>...
  multi_json (1.5.0)
  mysql (2.8.1)
  mysql2 (0.3.11)
  net-ldap (0.3.1)
  ...
  </code></pre>
  
  <p>and my database.yml file includes the following:</p>
  
  <pre><code>...
  production:
    adapter: mysql2
    database: redmine
    host: localhost
    username: ****
    password: ****
  
  development:
    adapter: mysql2
    database: redmine_development
    host: localhost
    username: ****
    password: ****
    encoding: utf8
  ...
  </code></pre>
  
  <p>Running <code>bundle install</code> seems to succeed, but mysql2 is not listed in the output, <code>which mysql2</code> returns nothing, and <code>bundle show mysql2</code> returns <code>Could not find gem 'mysql2' in the current bundle.</code></p>
  
  <p>I have uninstalled and reinstalled the mysql2 gem, with apparent success each time.</p>
  
  <p>I have read through descriptions of similar-sounding problems on other stackoverflow questions, but none of their solutions turned out to solve my problem. </p>