Postgresql Rails issues



我需要将应用程序从sqlite转换为Postgresql,以便使用thinkingsphinx搜索。我已经运行了以下步骤,我错过了什么?

我添加pg gem到我的gemfile,运行brew install postgresql,并配置了我的数据库。Yml文件如下:

development:
  adapter: postgresql
  database: example_development
  username: 
  password:
  host: localhost
  encoding: UTF8

我还运行了homebrew在安装时建议的命令:

If this is your first install, create a database with:
initdb /usr/local/var/postgres
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist

我的用户名和密码是什么?是否有一个文件,我需要编辑或我需要从命令行创建一个数据库?一定是我错过了什么简单的东西。我没有运行任何自定义sql查询,并且坚持使用活动记录默认值。

您需要指定您正在使用的Postgres数据库上的帐户的用户名和密码。

如果你没有本地postgres安装,那么就没有数据库可以连接,所以你必须遵循一些在线指导,这些指导概述了在你的开发机器上安装和设置postgres数据库。

最新更新