title: Ruby on Rails server cannot connect to mysql
body: <p>everyone.
  I am trying to set up rails 3 project with mysql as database on macOS X. However, I receive the next error:</p>
  
  <p><em>/usr/local/bundle/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:68:in connection_url_to_hash': undefined method `sub' for nil:NilClass (NoMethodError)</em></p>
  
  <blockquote>
    <p>config/database.yml</p>
  </blockquote>
  
  <pre><code>default: &amp;default
    adapter: mysql2
    pool: 5
    encoding: utf8
    min_messages: warning
    timeout: 5000
    username: root
    password:
    database: heart_development
    host: localhost
  </code></pre>
  
  <p>Can anyone suggest how to solve this problem?</p>