Ruby on rails PostgreSQL server无法在Cloud9中启动
我想在Cloud9中为我的rails应用程序设置postgresql 更改某些文件后显示以下错误Ruby on rails PostgreSQL server无法在Cloud9中启动,ruby-on-rails,postgresql,cloud9-ide,Ruby On Rails,Postgresql,Cloud9 Ide,我想在Cloud9中为我的rails应用程序设置postgresql 更改某些文件后显示以下错误 sudo service postgresql start * Starting PostgreSQL 9.3 database server * The PostgreSQL server failed to start. Please check the log output: 2016-04-09 23:49:54 UTC LOG: invalid connection type "Po
sudo service postgresql start
* Starting PostgreSQL 9.3 database server
* The PostgreSQL server failed to start. Please check the log output:
2016-04-09 23:49:54 UTC LOG: invalid connection type "PostgreSQL"
2016-04-09 23:49:54 UTC CONTEXT: line 1 of configuration file "/etc/postgresql/9.3/main/pg_hba.conf"
2016-04-09 23:49:54 UTC FATAL: could not load pg_hba.conf
...fail!
数据库.yml
default: &default
adapter: postgresql
encoding: unicode
pool: 5
host: localhost
username: ubuntu
password: password
development:
<<: *default
database: app_development
test:
<<: *default
database: app_test
production:
<<: *default
database: app_production
如果您能就如何避免此错误向我提供建议,我们将不胜感激。这可能是由于配置文件中的无效条目造成的。尝试使用
pg_ctl reload -D $PGDATA
还假设您的gem文件中有
gem'pg'
,这可能是由于配置文件中的无效条目造成的。尝试使用
pg_ctl reload -D $PGDATA
还假设您的gem文件中有
gem'pg'
,谢谢您的回答,@Abhilash。虽然我尝试了这个命令,但是出现了以下错误bash:pg\u ctl:command未找到
,我的gem文件中有gem'pg','~>0.18.2'
。也许你需要初始化目录。为此,你可以尝试initdb~/.postgres
和pg\u ctl-D~/.postgrestart
。但我以前从未用cloud9做过这件事……谢谢你的评论,@Abhilash。删除/etc/postgresql/9.3/main/pg_hba.conf
中的第一行后,不会显示任何错误。谢谢您的回答,@Abhilash。虽然我尝试了这个命令,但是出现了以下错误bash:pg\u ctl:command未找到
,我的gem文件中有gem'pg','~>0.18.2'
。也许你需要初始化目录。为此,你可以尝试initdb~/.postgres
和pg\u ctl-D~/.postgrestart
。但我以前从未用cloud9做过这件事……谢谢你的评论,@Abhilash。删除/etc/postgresql/9.3/main/pg_hba.conf
中的第一行后,不会显示任何错误。