【发布时间】:2013-04-18 14:03:45
【问题描述】:
每当我在本地环境中使用 postgreSQL 进行 Rails 应用程序开发时,我都会继续遇到问题。
我在 Mac OS X 10.7 上运行。我知道这个版本预装了 Postgres 版本。
我最初使用the brew method 安装了 Postgres,并且至少有几次成功。我知道用户身份验证问题。
在输入psql --version 或which psql 以确定正在使用哪个安装时,我必须先调整我的.bash_profile 以使用export PATH=/usr/local/bin:$PATH 反映适当的路径。
我现在遇到的问题是,我的机器在没有正确关闭 PostgreSQL 的情况下已经重新启动,而 Google 几个小时都没有解决这个问题。反过来,当我尝试在新应用程序上执行 rake db:create 时,我收到以下错误,我收到以下错误:
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"app_development", "pool"=>5, "username"=>"tomgeoco", "password"=>nil}
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"?
我的 config/database.yml 看起来像:
development:
adapter: postgresql
encoding: unicode
database: app_development
pool: 5
username: tomgeoco
password:
test:
adapter: postgresql
encoding: unicode
database: app_development
pool: 5
username: tomgeoco
password:
production:
adapter: postgresql
encoding: unicode
database: app_development
pool: 5
username: tomgeoco
password:
当我使用 ps auxwww | grep postgre 检查 Postgres 服务器的状态时,我得到以下信息:
tomgeoco 12596 0.0 0.0 2434892 408 s000 R+ 11:54AM 0:00.00 grep postgres
那么在这种情况下会出现什么问题呢?
【问题讨论】:
-
password"=>nil || 你用有效密码试过了吗?
标签: ruby-on-rails rails-postgresql