title: Deployed rails app to Elastic beanstalk can't connect to RDS
body: <p>I'm trying to deploy my app to Elastic Beanstalk by following <a href="http://ruby.awsblog.com/post/Tx2AK2MFX0QHRIO/Deploying-Ruby-Applications-to-AWS-Elastic-Beanstalk-with-Git" rel="nofollow">this tutorial</a>.</p>
  
  <p>The app works if I use <code>splite3</code>, but I can't connect the app to RDS.</p>
  
  <p>I added <code>group :production do gem 'mysql2' end</code> in Gemfile, and this code to <code>config/database.yml</code>.</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 added RDS in <a href="https://console.aws.amazon.com/elasticbeanstalk/" rel="nofollow">Elastic Beanstalk console</a>.</p>
  
  <p>But <code>production.log</code> shows error, that indicates DB connection fails.</p>
  
  <pre><code>-------------------------------------
  /var/app/support/logs/production.log
  -------------------------------------
  I, [2014-02-09T16:01:56.520967 #29379]  INFO -- : Started GET "/" for xxx.xxx.xxx.xxx at 2014-02-09 16:01:56 +0000
  I, [2014-02-09T16:01:56.620738 #29379]  INFO -- : Processing by PostsController#index as HTML
  E, [2014-02-09T16:01:56.629835 #29379] ERROR -- : Mysql2::Error: Table 'ebdb.posts' doesn't exist: SELECT `posts`.* FROM `posts`
  I, [2014-02-09T16:01:56.630802 #29379]  INFO -- :   Rendered posts/index.html.erb within layouts/application (4.3ms)
  I, [2014-02-09T16:01:56.631068 #29379]  INFO -- : Completed 500 Internal Server Error in 10ms
  F, [2014-02-09T16:01:56.633962 #29379] FATAL -- : 
  ActionView::Template::Error (Mysql2::Error: Table 'ebdb.posts' doesn't exist: SELECT `posts`.* FROM `posts`):
  </code></pre>
  
  <p><code>eb status</code> shows like this.</p>
  
  <pre><code>URL     : myAppURL
  Status      : Ready
  Health      : Green
  
  RDS Database: AWSEBRDSDatabase | myDatabaseURL:port
  </code></pre>
  
  <p>Probably I miss something very basic. What should I do to fix this problem?</p>