Library not loaded: /usr/local/lib/libpq.5.4.dylib

前端 未结 6 1741
轻奢々
轻奢々 2021-01-01 08:54

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

6条回答
  •  死守一世寂寞
    2021-01-01 09:30

    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.

提交回复
热议问题