2017-09-15 15 views
0

データベースを作成する際に問題が発生しています。Rake db:サーバーへの接続に失敗しました。

私のpostgresqlは確実に動作しています。ここで

はdatabase.ymlのだ:

development: 
    <<: *default 
    database: name_of_database 
    User: username 
    Password: tototo 

私はメッセージが表示されます。

Called from /usr/local/bundle/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency' 
could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 
/usr/local/bundle/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize' 
/usr/local/bundle/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new' 
[...] 
/usr/local/bundle/bin/rake:17:in `<main>' 
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"name_of_database", "User"=>"username", "Password"=>"tototo"} 
could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 
[...] 
/usr/local/bundle/gems/rake-12.0.0/lib/rake/application.rb:77:in `run' 
/usr/local/bundle/gems/rake-12.0.0/exe/rake:27:in `<top (required)>' 
/usr/local/bundle/bin/rake:17:in `load' 
/usr/local/bundle/bin/rake:17:in `<main>' 
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"name_of_database"} 

私はそれをすべての権利を与えるユーザーを作成しました。

IDを使用してクライアントでpostgresqlに接続できます。 私はポストグルに接続するために成功した他のプロジェクトがあります。

誰かがこれを修正するアイデアはありますか?

ありがとうございました。あなたはpostgresサーバはこの

$sudo service postgresql restart 

を試し始めたではないかもしれません

+0

があなたのコンファイル –

答えて

1

次に、あなたのレールに行く

$rake db:setup 
$rake db:seed 
$rake db:migrate 
+0

を投稿プロジェクト私はpsqlのクライアントとそれに接続することができました。したがって、postgresqlサーバーが実行中であることを意味します。 –

+0

@ YoannPicquenotこの問題を解決できましたか?私は今同じ問題に走っています – DaudiHell

+0

@DaudiHellはい、私はレーキを使用しませんでした。私は手動ですべてのステップを行った。 –

関連する問題