开发者

Postgresql Rails issues

开发者 https://www.devze.com 2023-04-13 02:00 出处:网络
I need to convert an app from sqlite to Postgresql in order to use search with thinkingsphinx. I have run the following steps what am I missing?

I need to convert an app from sqlite to Postgresql in order to use search with thinkingsphinx. I have run the following steps what am I missing?

I added the pg gem to my gemfile, ran brew install postgresql, and have configured my database.yml file as follows:

development:
开发者_Go百科  adapter: postgresql
  database: example_development
  username: 
  password:
  host: localhost
  encoding: UTF8

I have also run the commands that homebrew suggests on installation:

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

What do I put for my username and password? Is there a file I need to edit or do I need to create a database from the command line? There must be something simple that I am missing. I haven't run any custom sql queries, and have stuck to active record defaults.


You need to specify the username and password of the account on the Postgres database you are using.

If you do not have a local postgres installation running, then there is no database to connect to, so you will have to follow some instructions online that outline installing and setting up a postgres database on your development machine.

0

精彩评论

暂无评论...
验证码 换一张
取 消