I am working on a rails app.
Installed Postgresql using postgresql-9.1.2-1-osx.dmg
Installed pg gem.
Then when I executed rake db:create
getting the
In my case, uninstalling /reinstalling gem didn't help. But I added the PostgreSQL library path to $DYLD_LIBRARY_PATH environment variable in my ~/.bash_profile:
export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH
If you also have MySQL installed, this line can look like:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH
Of course pay attention to version number in the PostgreSQL path, at the time of this writing it is 9.3. I'm using RVM, Ruby 2.0.0, pg gem 0.17.0, on Mac OS X 10.6.