OS X rails3 postgresql无法创建数据库,无法识别其默认用户名 [英] OS X rails3 postgresql cannot create database not recognizing its default username

查看:103
本文介绍了OS X rails3 postgresql无法创建数据库,无法识别其默认用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行OS X 10.6的计算机上,rails 3.2环境正在尝试创建数据库,但失败。

On a machine running OS X 10.6 a rails 3.2 environment is attempting to create the databases, but failing.

经过测试的宝石:包括0.9.2.2(安装一些依赖项)和声明的10.0.4。
用户名已在database.yml中定义

Rake gems tested: include 0.9.2.2 (installed by some dependency) and a declared 10.0.4. username is defined in database.yml


无法为{ adapter => postgresql,$创建数据库b $ b数据库 => app_development,用户名 => postgres}

Couldn't create database for {"adapter"=>"postgresql", "database"=>"app_development", "username"=>"postgres"}

FATAL:角色
postgres不存在

FATAL: role "postgres" does not exist

但是,这不是计算机上的第一个应用程序。所有其他应用程序都使用该用户名连接到postgre集群。

Yet, this is not the first application on the machine. All other applications connect to the postgre cluster with that username. How can this instance not recognize the role and in the others, yes?

推荐答案

只是一个猜测:您使用自制软件安装了PG,对?如果是这样,则管理员用户是您自己的用户名(在终端中键入 whoami ),而不是postgres。

Just a guess: you installed PG with homebrew, right? If so, the admin user is your own username (type whoami in a terminal), rather than postgres.

这篇关于OS X rails3 postgresql无法创建数据库,无法识别其默认用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆