Cannot install pg gem in Mavericks with Postgres.app

后端 未结 8 1668
灰色年华
灰色年华 2020-12-02 04:16

I am trying to install the pg gem for use with Postgres.app on my local machine. I am running Mavericks.

Postgres.app is installed and running fine, but I cannot get

8条回答
  •  醉酒成梦
    2020-12-02 04:35

    Being on a brand new mac, here's what I had to do:

    1. Install Xcode tools from the app store
    2. Open Xcode tools and accept the license
    3. Now run (hopefully a future-proofed command):

      version=$(ls /Applications/Postgres.app/Contents/Versions/ | tail -1) gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/$version/bin/pg_config .

    If you have trouble, you can troubleshoot a bit by checking out the actual error in the mkmf.log which you can find by running (if using rvm):

    cd ~/.rvm ; find . -name mkmf.log | grep pg
    

提交回复
热议问题