gem install pg doesn't work on OSX Lion

后端 未结 13 1042
天命终不由人
天命终不由人 2020-12-07 15:08

There are variations of this question bouncing around SO, but none of them seem to have an answer that solves my problem.

I am running OSX Lion (10.7.3). The latest

相关标签:
13条回答
  • 2020-12-07 15:24

    On OS X Mavericks

    sudo ln -s /usr/bin/llvm-gcc /usr/bin/gcc-4.2
    

    works.

    0 讨论(0)
  • 2020-12-07 15:27

    I also ran into this issue, for me the answer was updating RVM of all things.

    rvm get head
    rvm install 1.9.2
    
    0 讨论(0)
  • 2020-12-07 15:27

    I am on Mountain Lion, and the accepted answer from Dave Isaacs worked for me. I also had to do

    sudo ln -s llvm-g++-4.2 g++-4.2
    
    0 讨论(0)
  • 2020-12-07 15:28

    After a Mavericks upgrade...

    Reinstall your ruby version.

    rvm uninstall 1.9.2-p320
    

    then

    rvm install 1.9.2-p320
    

    or whatever version of ruby you have.

    0 讨论(0)
  • 2020-12-07 15:30

    I too, am on Mountain Lion, besides the "sudo ln -s /usr/bin/{llvm-,}gcc-4.2" suggested by @grilix, I needed to do:

    sudo ln -s /usr/bin/{llvm-,}g++-4.2
    
    0 讨论(0)
  • 2020-12-07 15:30
    $ gem install pg
    

    If that failed:

    $ sudo gem install pg
    

    Then, if that failed:

    $ sudo find / -name “pg_config”
    

    After you find pg_config's location, run this to finally install it:

    $ sudo gem install pg --with-pg-config=/usr/local/Cellar/postgresql/9.5.1/bin/pg_config
    

    Of course, you'll want to change the path to wherever you found pg_config.

    Then, check your installed gems with gem list, and it should show something like this:

    <code>gem list</code> showing the right things

    More information can be found in my guide.

    0 讨论(0)
提交回复
热议问题