同様の質問がたくさんありますが、すべてが少し異なります。rails 4 PG :: ConnectionBadがサーバーに接続できませんでした
Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.6'
gem 'pg', '~> 0.15'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
gem 'rspec-rails', '~> 3.4'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
のRails 4.2.6とコマンドラインでpsql
をやっては返さ:
PG::ConnectionBad (could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
はまた、レール・サーバを起動し、しようとした後、ブラウザでも同じですルートパスをロードします。
私は、コマンドラインでpostgres
をやっては返す、いずれかの動作しないことが判明:
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
あなたのpostgresサーバが稼働している必要があります。 Railsの応答性がデータベースサーバを起動しません – DennisCastro