title: String can't be coerced into Integer, when running rake db:create in test environment
body: <p>I am trying to create a Test database using rake db:create, It gives me the following error, I have recently upgraded from rails 3.2.17 to 3.2.22.5.</p>
  
  <pre><code>RAILS_ENV=test rake db:create --trace
  
  ** Invoke db:create (first_time)
  ** Invoke db:load_config (first_time)
  ** Execute db:load_config
  ** Invoke rails_env (first_time)
  ** Execute rails_env
  ** Execute db:create
  String can't be coerced into Integer
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activesupport3.2.22.5/lib/active_support/core_ext/enumerable.rb:60:in `+'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activesupport3.2.22.5/lib/active_support/core_ext/enumerable.rb:60:in `sum'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activesupport3.2.22.5/lib/active_support/core_ext/enumerable.rb:60:in `sum'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activerecord3.2.22.5/lib/active_record/connection_adapters/postgresql_adapter.rb:747:in `create_database'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activerecord3.2.22.5/lib/active_record/railties/databases.rake144:in `rescue in create_database'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activerecord3.2.22.5/lib/active_record/railties/databases.rake:84:in `create_database'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activerecord3.2.22.5/lib/active_record/railties/databases.rake:62:in `block (3 levels) in &lt;top (required)&gt;'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activerecord3.2.22.5/lib/active_record/railties/databases.rake:62:in `each'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/activerecord3.2.22.5/lib/active_record/railties/databases.rake:62:in `block (2 levels) in &lt;top (required)&gt;'
  /data/rvm_installtion/.rvm/gems/ruby2.4.3@waltz/gems/rake10.5.0/lib/rake/task.rb:240:in `block in execute'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake10.5.0/lib/rake/task.rb:235:in `each'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake10.5.0/lib/rake/task.rb:235:in `execute'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake10.5.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
  /data/rvm_installtion/.rvm/rubies/ruby-2.4.3/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/task.rb:165:in `invoke'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:150:in `invoke_task'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:106:in `each'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:106:in `block in top_level'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:115:in `run_with_threads'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:100:in `top_level'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:78:in `block in run'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:176:in `standard_exception_handling'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/lib/rake/application.rb:75:in `run'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/gems/rake-10.5.0/bin/rake:33:in `&lt;top (required)&gt;'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/bin/rake:23:in `load'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/bin/rake:23:in `&lt;main&gt;'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/bin/ruby_executable_hooks:15:in `eval'
  /data/rvm_installtion/.rvm/gems/ruby-2.4.3@waltz/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  Couldn't create database for {"adapter"=&gt;"postgresql", "encoding"=&gt;"unicode", "pool"=&gt;5, "username"=&gt;"postgres", "host"=&gt;"localhost", "database"=&gt;"test_database_name"}
  </code></pre>
  
  <p>Please suggest.
  I am using Ruby 2.4.3 and Rails 3.2.22.5.</p>
  
  <p>here is my database.yml file</p>
  
  <pre><code>DEFAULTS: &amp;DEFAULTS
  adapter: postgresql
  encoding: unicode
  pool: 5
  username: postgres
  host: localhost
  
  development:
  &lt;&lt;: *DEFAULTS
  database: development
  
  test: &amp;test
  &lt;&lt;: *DEFAULTS
  database: test_2
  
  staging:
  &lt;&lt;: *test
  
  production:
  &lt;&lt;: *test
  </code></pre>
  
  <p>Thanks in Advance</p>