Error requiring pg under rvm with postgres.app

前端 未结 4 1476
感情败类
感情败类 2021-01-19 03:12

I\'m using Postgres.app on OS X (10.8.3). I have modified my PATH so that the bin folder for the app is before all others.

Rammy:~          


        
4条回答
  •  庸人自扰
    2021-01-19 03:31

    Edit: Even though this answer currently has more votes than the accepted answer, the accepted answer is far simpler and cleaner.


    Remove the Postgres.app binaries from the path when installing the pg gem, and instead use the postgres install built into OS X to configure the gem. The pg library will still correctly connect to the Postgres.app server later on.

    Rammy:~ phrogz$ gem uninstall pg
    Successfully uninstalled pg-0.15.1
    
    # Modify PATH to remove /Applications/Postgres.app/Contents/MacOS/bin
    
    Rammy:~ phrogz$ gem install pg
    Fetching: pg-0.15.1.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed pg-0.15.1
    1 gem installed
    
    Rammy:~ phrogz$ ruby -v -e "require 'pg'"
    ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0]
    

提交回复
热议问题