【发布时间】:2016-10-27 13:34:42
【问题描述】:
有很多类似的问题,但都略有不同。
宝石文件:
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"?
在启动 rails 服务器并尝试加载根路径后,在浏览器中也得到了相同的结果。
我发现在命令行中做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.
【问题讨论】:
标签: ruby-on-rails ruby postgresql