Traditionally, pogstgresql is installed manually with MacPort or Homebrew on Mac OSX 10.7+. I used to have lots of problem with the setup for the installation as it requires Xcode, this libs and that libs, etc. In summary, it is not convenient enough and I want something as simple as dragging an OS app to my /Application. Thanks to Heroku, they took the heed and create Postgres.app. A wrapper bundled with binary postgresql server. It is not only easy to install but also easy to setup config file if you are using Rails.
If you have installed postgres using Homebrew or Macport, please make sure you uninstall it first.
Head to http://postgresapp.com/ and download DMG into your localbox. Mount the DMG and drag the Postgres.app icon into your Applications folder.
No configuration at all! Simply click on Postgres.app to start it and the app will reside in your top bar tray (elephant icon). You can set it to start on start up by click on Elephant Icon on top bar tray and click Automatically Start on Login. That’s it, dead simple compare to setting up plist launcher file.
PostgreSQL ships with a constellation of useful binaries, like
pg_restore, that you will likely want to use.
Go ahead and add the
/bin directory that ships with Postgres.app to your
PATH. Add this to your
Once setup, you could refresh your terminal session with:
And try to run
psql without a host, if everything is correct, you should be able to get into the the postgres console
Configure Rails database connection
Use following settings in
1 2 3 4
Install pg gem
In order to install
pg gem, we need to uninstall
pg first and re-installed with: