2016-04-10 35 views
1

私のレールアプリのpostgresqlをCloud9に設定したいと思います。Cloud9で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 "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! 

database.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 

/etc/postgresql/9.3/main/ pg_hba.confの

PostgreSQL Client Authentication Configuration File 
... 

# Database administrative login by Unix domain socket 
local localhost   postgres        peer 

# TYPE DATABASE  USER   ADDRESS     METHOD 

# "local" is for Unix domain socket connections only 
local all    ubuntu         peer 
# IPv4 local connections: 
host all    all    127.0.0.1/32   md5 
# IPv6 local connections: 
host all    all    ::1/128     md5 
... 

あなたは私を助言することができればそれをいただければ幸いですこのエラーを回避する方法。

答えて

0

これは、おそらく設定ファイルのエントリが無効であるためです。

pg_ctl reload -D $PGDATA 

を使用して、それをリロードしてみてくださいすることはまた、あなたがあなたのgemfile

+0

gem 'pg'を持っていることを前提としてあなたの答え、@Abhilashいただきありがとうございます。このコマンドを試しましたが、次のようなエラーが発生しました。 'bash:pg_ctl:command not found'そして私のgemfileには' gem 'pg'、 '〜> 0.18.2''があります。 – SamuraiBlue

+0

ディレクトリを初期化する必要があるかもしれません。そのために 'initdb〜/ .postgres'と' pg_ctl -D〜/ .postgres start'を試すことができます。しかし、前にcloud9で行う必要はありません... – Abhilash

+0

あなたのコメントのために、@Abhilash。 '/ etc/postgresql/9.3/main/pg_hba.conf'の1行目を削除してもエラーは表示されません。 – SamuraiBlue

関連する問題