データベースを作成する際に問題が発生しています。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
を試し始めたではないかもしれません
があなたのコンファイル –