Reputation: 491
I have been using the default sqlite3 to date, however as I would ultimately like to deploy using postgres I think it would be best to try it out in my development environment rather than launching myself into production untested.
Several points a) once i have the pg.app running, how do test it? b) in my config/database.yml file
development:
adapter: postgresql
encoding: unicode
database:
pool: 5
username:
password:
how do i know what the default name of my database is, and how would I got about setting up a user, is this even necessary?
Finally, when i check
which psql
I am told that
/usr/bin/psql
I think that this PATH is incorrect that I will need to modify it, is this so and if so why?
Im sure this is relatively simple but thanks in advance for any help you can offer.
EDIT 1:
During my error googling, and prior attempts, I shot up a similar error to this chap Repairing Postgresql after upgrading to OSX 10.7 Lion and thought that it may be a similar problem despite the fact that he is using homebrew?
EDIT 2:
My .bash_profile file
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function export PATH=/usr/local/bin:$PATH
Upvotes: 0
Views: 2444
Reputation: 9604
A few things you need to do to get postgres.app
up and running. It looks like you are using the default postgres install with Mac OS X /usr/bin/psql
which is good as it should be easy to get this fixed.
The main action is to make sure that the path to the postgres.app
is set in your PATH
. Your .profile
, .bashrc
or .zshrc
(whichever you use) should have the following appended to the start of your Path with the following.
export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
This will ensure that postgres.app
is used in preference to any other install by prepending it to your current path. You shouldn't need any other config,
The second action is to set up your database.yml
. Postgres.app
comes pre-configured with your local Mac username so you don't need to add or change it for everything to just work. You also don't need to specify it in database.yml
. Development should work with the following:
development:
adapter: postgresql
host: localhost
encoding: unicode
database: appname_development
Postgres.app
will auto create the database that has been specified when you migrate the database for the first time. The name of your database is up to you but the convention is application_name
underscore environment
.
Upvotes: 3