Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created June 5, 2010 12:36
Show Gist options
  • Select an option

  • Save workmad3/426594 to your computer and use it in GitHub Desktop.

Select an option

Save workmad3/426594 to your computer and use it in GitHub Desktop.
Get the .dmg
There is a one-click installer available for PostgreSQL on Mac OS X. It packages the database up as a .dmg file. It is available here: http://www.enterprisedb.com/products/pgdownload.do#osx
Edit your PATH
The .dmg does the installation and setup, but it doesn't alter your PATH variable to include the PostgreSQL tools. To do this, edit
~/.bash_profile
and add the lines
PATH="/Library/PostgreSQL/8.4/bin/:${PATH}" export PATH
Installing the postgres rubygem for Rails
Once you have the binaries in your path, installing the postgres driver for ruby is simple. Just run
sudo gem install pg
This should compile the native extensions using pg_config for the required environment variables. Once done, you can access a PostgreSQL database from Ruby, or set it as the adapter for a Ruby on Rails database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment