pg gem '0.14.0' on Mountain Lion fails

后端 未结 10 1894
孤街浪徒
孤街浪徒 2020-12-10 12:56

I just upgraded from OS X Lion to OS X Mountain Lion. My rails environment for the most part stayed in tact.

The only steps I had to do to get things back to a good

相关标签:
10条回答
  • 2020-12-10 13:09

    Deefour's comment got it! It was the way I installed PostgreSQL.

    I use the PostgreSQL one-click installer which I'm guessing doesn't set up the libpq up properly for Mountain Lion.

    Homebrew on the otherhand will build it properly for the OS.

    After installing postgres through homebrew

    brew install postgresql
    

    I was able to install my gem no problem.

    Thanks everybody!

    0 讨论(0)
  • 2020-12-10 13:10

    I just got mine up and running via this ticket:

    How can I pass a parameter for gem installation when I run bundle install?

    bundle config build.pg --with-pg-config=/path/to/pg_config
    bundle install
    

    Like Matt, Ranjan, and Peter Mellett all say, you have to get the right pg_config location, and Mountain Lion comes with a different location that doesn't seem to play well with rubygems, so if you find your old version like

    /Library/PostgreSQL/bin/pg_config
    

    then you can set that in the bundle config before installing.

    My situation was upgrading from Lion to Mountain Lion.

    0 讨论(0)
  • 2020-12-10 13:13

    Homebrew installed pg_ctl in /usr/local/bin/pg_ctl, so the command for me was:

    env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/usr/local/bin/pg_ctl
    
    0 讨论(0)
  • 2020-12-10 13:26

    I have had the same problem but reinstalling postgresql with homebrew did not solve it. However, this command did it for me:

    sudo env ARCHFLAGS="-arch x86_64" gem install pg
    
    0 讨论(0)
提交回复
热议问题