title: Rails & Amazon RDS: "production database is not configured"
body: <p>I'm brand new to all things AWS, and trying to boot up my Rails app on Beanstalk. I'm following the <a href="http://ruby.awsblog.com/post/Tx2AK2MFX0QHRIO/Deploying-Ruby-Applications-to-AWS-Elastic-Beanstalk-with-Git" rel="nofollow">recent tutorial</a>, but I'm stuck getting my app connected to RDS. The passenger screen comes up with an error:</p>
  
  <pre><code>production database is not configured (ActiveRecord::AdapterNotSpecified)
  </code></pre>
  
  <p>My <code>database.yml</code> looks like:</p>
  
  <pre><code>production:
    adapter: mysql2
    encoding: utf8
    database: &lt;%= ENV['RDS_DB_NAME'] %&gt;
    username: &lt;%= ENV['RDS_USERNAME'] %&gt;
    password: &lt;%= ENV['RDS_PASSWORD'] %&gt;
    host: &lt;%= ENV['RDS_HOSTNAME'] %&gt;
    port: &lt;%= ENV['RDS_PORT'] %&gt;
  </code></pre>
  
  <p>I do have an RDS instance configured and running. I also ssh'ed into the EC2 instance, and verified that I can successfully connect to the RDS via RDS_USERNAME, RDS_HOSTNAME, etc.</p>
  
  <p>Thinking that perhaps I needed to manually create my database in MySQL I used the MySQL client to do that, but I still get the same error. </p>
  
  <p>So again on the EC2 instance I checked out my project manually and ran <code>bundle exec rake db:migrate --trace</code> to get a more complete picture of where it's failing:</p>
  
  <pre><code>** Invoke db:migrate (first_time)
  ** Invoke environment (first_time)
  ** Execute environment
  ** Invoke db:load_config (first_time)
  ** Execute db:load_config
  rake aborted!
  production database is not configured
  /usr/share/ruby/1.9/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:in `resolve_string_connection'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:129:in `establish_connection'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/railtie.rb:82:in `block (2 levels) in &lt;class:Railtie&gt;'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:42:in `each'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/base.rb:721:in `&lt;top (required)&gt;'
  /usr/share/ruby/1.9/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:6:in `block (2 levels) in &lt;top (required)&gt;'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:227:in `call'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:227:in `block in execute'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:222:in `each'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:222:in `execute'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
  /usr/share/ruby/1.9/monitor.rb:211:in `mon_synchronize'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:187:in `block in invoke_prerequisites'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:185:in `each'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:185:in `invoke_prerequisites'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:165:in `block in invoke_with_call_chain'
  /usr/share/ruby/1.9/monitor.rb:211:in `mon_synchronize'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/task.rb:152:in `invoke'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:141:in `invoke_task'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:99:in `block (2 levels) in top_level'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:99:in `each'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:99:in `block in top_level'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:108:in `run_with_threads'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:93:in `top_level'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:71:in `block in run'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/lib/rake/application.rb:68:in `run'
  /usr/share/ruby/1.9/gems/1.9.1/gems/rake-10.0.2/bin/rake:37:in `&lt;top (required)&gt;'
  /usr/bin/rake:23:in `load'
  /usr/bin/rake:23:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:migrate =&gt; db:load_config
  </code></pre>