How to resolve the error 'fe_sendauth: no password supplied' in Rails using PostgreSQL? -
i've tried create rails app postgresql database, when started rails server
, got error:
fe_sendauth: no password supplied
here're actions step step:
$ sudo apt-get install postgresql postgresql-contrib $ gem install pg $ rails new timetracker --database=postgresql --skip-unit-test
my database.yml
file looks this:
default: &default adapter: postgresql encoding: unicode pool: 5 host: localhost username: postgres password: development: <<: *default database: timetracker_development test: <<: *default database: timetracker_test production: <<: *default database: timetracker_production
and here's pg_hba.conf
file:
# database administrative login unix domain socket local postgres peer # type database user address method # "local" unix domain socket connections local peer # ipv4 local connections: host 127.0.0.1/32 md5 # ipv6 local connections: host ::1/128 md5 # modified me. host 127.0.0.1/32 trust host 127.0.0.1/32 trust host ::1/128 trust
so, when rails server
error , here's doing this:
$ rails c $ activerecord::base.connection.instance_variable_get(:@config)
2.1.5 :001 > activerecord::base.connection.instance_variable_get(:@config) pg::connectionbad: fe_sendauth: no password supplied
from /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in
initialize' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in
new' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:655:inconnect' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in
initialize' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:44:innew' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in
postgresql_connection' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:innew_connection' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in
checkout_new_connection' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:inacquire_connection' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in
block in checkout' /home/denis/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:inmon_synchronize' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in
checkout' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:inblock in connection' /home/denis/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:in
mon_synchronize' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:inconnection' /home/denis/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in
retrieve_connection' ... 4 levels... /home/denis/.rvm/gems/ruby-2.1.5/gems/railties-4.2.3/lib/rails/commands/console.rb:9:instart' /home/denis/.rvm/gems/ruby-2.1.5/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:68:in
console' /home/denis/.rvm/gems/ruby-2.1.5/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:inrun_command!' /home/denis/.rvm/gems/ruby-2.1.5/gems/railties-4.2.3/lib/rails/commands.rb:17:in
' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:inrequire' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in
block in require' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:inload_dependency' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in
require' /home/denis/web/rails/timetracker/bin/rails:8:in<top (required)>' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in
load' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:inblock in load' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in
load_dependency' /home/denis/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:inload' /home/denis/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in
require' /home/denis/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:inrequire' -e:1:in
'2.1.5 :002 >
i'm using postgresql first time , guess i'm doing wrong.
could please me that?
my solution problem remove host: localhost
default:
group.
Comments
Post a Comment