title: PSQL 9.3 ident authentication error on Fedora 21
body: <p>[PSGQL 9.3, Fedora 21, Rails 4.2.0]</p>
  
  <p>When I run any rails db command (rake db:migrate, rake db:create, etc), this error happen:</p>
  
  <pre><code>[dguedes@localhost clean_forum]$ rake db:create
  FATAL:  Ident authentication failed for user "dguedes"
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:93:in `create'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:275:in `block in each_current_configuration'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each_current_configuration'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:17:in `block (2 levels) in &lt;top (required)&gt;'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `call'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `each'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `each'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:75:in `run'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/bin/rake:33:in `&lt;main&gt;'
  Couldn't create database for {"adapter"=&gt;"postgresql", "encoding"=&gt;"UTF8", "database"=&gt;"forum_development", "pool"=&gt;5, "username"=&gt;"dguedes", "password"=&gt;"randompass", "host"=&gt;"localhost"}
  FATAL:  Ident authentication failed for user "dguedes"
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:93:in `create'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:275:in `block in each_current_configuration'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each_current_configuration'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
  /home/dguedes/.rvm/gems/ruby-2.2.0@rails4.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:17:in `block (2 levels) in &lt;top (required)&gt;'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `call'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `each'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `each'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:75:in `run'
  /home/dguedes/.rvm/rubies/ruby-2.2.0/bin/rake:33:in `&lt;main&gt;'
  Couldn't create database for {"adapter"=&gt;"postgresql", "encoding"=&gt;"unicode", "database"=&gt;"forum_test", "pool"=&gt;5, "username"=&gt;"dguedes", "password"=&gt;"randompass", "host"=&gt;"localhost"}
  </code></pre>
  
  <p>In postgres, I already created the role 'dguedes' with the correct password, and granted all privileges. For example:</p>
  
  <pre><code>bash-4.3$ psql -d forum_development -U dguedes
  could not change directory to "/home/dguedes/Desktop/forum/clean_forum": Permission denied
  Password for user dguedes: 
  psql (9.3.5)
  Type "help" for help.
  
  forum_development=# \du
                               List of roles
   Role name |                   Attributes                   | Member of 
  -----------+------------------------------------------------+-----------
   dguedes   | Superuser, Create role, Create DB, Replication | {}
   postgres  | Superuser, Create role, Create DB, Replication | {}
  
  forum_development=# 
  </code></pre>
  
  <p>That shows that my role already have all the permissions. </p>
  
  <p>My ph_hba.conf file:</p>
  
  <pre><code># TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     md5
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            ident
  # IPv6 local connections:
  host    all             all             ::1/128                 ident
  # Allow replication connections from localhost, by a user with the
  # replication privilege.
  #local   replication     postgres                                md5
  #host    replication     postgres        127.0.0.1/32            ident
  #host    replication     postgres        ::1/128                 ident
  </code></pre>
  
  <p>I restarted the server with the command 'systemctl stop postgresql-9.3' and 
  'systemctl start postgresql-9.3', but nothing happened.</p>
  
  <p>And, finally, my 'database.yml' file:</p>
  
  <pre><code>development:
    adapter: postgresql
    encoding: UTF8
    database: forum_development
    pool: 5
    username: dguedes
    password: randompass
    host: localhost
  
  test:
    adapter: postgresql
    encoding: unicode
    database: forum_test
    pool: 5
    username: dguedes
    password: randompass
    host: localhost
  </code></pre>
  
  <p>So, I can't figure the problem. I already try'd to reinstall postgre to clean everything but just don't worked. What looks wrong?</p>