title: Invalid DATABASE_URL When Using Heroku Multiple Environments
body: <p>I'm trying to do this tutorial from Heroku.</p>
  
  <p><a href="http://devcenter.heroku.com/articles/multiple-environments" rel="nofollow">http://devcenter.heroku.com/articles/multiple-environments</a></p>
  
  <p>However, when I try to do this command:</p>
  
  <pre><code>heroku rake db:migrate --remote staging
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>rake aborted!
  Invalid DATABASE_URL
  
  Tasks: TOP =&gt; db:migrate =&gt; db:load_config
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>With --trace:</p>
  
  <pre><code>** Invoke db:migrate (first_time)
  ** Invoke environment (first_time)
  ** Execute environment
  ** Invoke db:load_config (first_time)
  ** Invoke rails_env (first_time)
  ** Execute rails_env
  ** Execute db:load_config
  rake aborted!
  Invalid DATABASE_URL
  (erb):9:in `rescue in &lt;main&gt;'
  (erb):6:in `&lt;main&gt;'
  /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `eval'
  /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `result'
  /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.3/lib/rails/application/configuration.rb:106:in `database_configuration'
  /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie.rb:68:in `block (2 levels) in &lt;class:Railtie&gt;'
  /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
  /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
  /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
  /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
  /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
  /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/base.rb:2190:in `&lt;top (required)&gt;'
  /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:6:in `block (2 levels) in &lt;top (required)&gt;'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
  /usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
  /usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
  /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `&lt;top (required)&gt;'
  /app/.bundle/gems/ruby/1.9.1/bin/rake:19:in `load'
  /app/.bundle/gems/ruby/1.9.1/bin/rake:19:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:migrate =&gt; db:load_config
  </code></pre>
  
  <p>Anyone here have the similar experience? Thank you so much.</p>