Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails postgres的Ruby on Rails身份验证错误_Ruby On Rails_Ruby_Postgresql_Authentication - Fatal编程技术网

Ruby on rails postgres的Ruby on Rails身份验证错误

Ruby on rails postgres的Ruby on Rails身份验证错误,ruby-on-rails,ruby,postgresql,authentication,Ruby On Rails,Ruby,Postgresql,Authentication,我已经在本地创建了Postgresql数据库。 这是我的database.yml文件。 默认值:&默认值 适配器:postgresql 游泳池:5 超时:5000 development: <<: *default database: myrubyblog username: postgres password: Naruto1994. # Warning: The database defined as "test" will be erased and # r

我已经在本地创建了Postgresql数据库。

这是我的database.yml文件。 默认值:&默认值 适配器:postgresql 游泳池:5 超时:5000

development:
  <<: *default
  database: myrubyblog
  username: postgres
  password: Naruto1994.

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: myrubyblog
  username: postgres
  password: Naruto1994.

production:
  <<: *default
  database: myrubyblog
  username: postgres
  password: Naruto1994.
开发:

您可以添加localhost,并确保您的密码是带点还是不带点(鸣人1994),我的建议是在每个环境(开发、测试和生产)之间拆分数据库名称


您可以添加localhost,并确保您的密码是带点还是不带点(鸣人1994),我的建议是在每个环境(开发、测试和生产)之间拆分数据库名称


类似这样的消息表示您联系了服务器,并且它愿意与您交谈,但在您通过pg_hba.conf文件中指定的授权方法之前,它不会这样做

试试这个:

// set new password for user "postgres"
$sudo su postgres -c 'psql --username=postgres'
ALTER USER postgres with encrypted password 'your_password';
//change pg_hba.conf
local all postgres md5
然后重新启动postgres


这篇文章可能会对您有所帮助:

这样的消息表明您联系了服务器,并且它愿意与您交谈,但除非您通过pg_hba.conf文件中指定的授权方法

试试这个:

// set new password for user "postgres"
$sudo su postgres -c 'psql --username=postgres'
ALTER USER postgres with encrypted password 'your_password';
//change pg_hba.conf
local all postgres md5
然后重新启动postgres


这篇文章可能会帮助您:

您只需要将
host:localhost
添加到每个env。e、 g

development:
  <<: *default
  database: myrubyblog
  host: localhost
  username: postgres
  password: Naruto1994.
开发:

您只需要向每个env添加
host:localhost
。e、 g

development:
  <<: *default
  database: myrubyblog
  host: localhost
  username: postgres
  password: Naruto1994.
开发:

是否尝试从密码中删除点?另外,如何创建数据库?您是否已在psql上设置了此密码?请尝试从密码中删除点?另外,如何创建数据库?你真的在psql上设置了这个密码吗?