unable to install pg gem

后端 未结 20 783
不知归路
不知归路 2020-12-02 04:54

I tried using gem install pg but it doesn\'t seem to work.

gem install pg gives this error

Temporarily enhancing PATH to in         


        
相关标签:
20条回答
  • 2020-12-02 05:18

    Use with ARCH flag.

    sudo env ARCHFLAGS="-arch x86_64" gem install pg
    

    This resolved the same issue you are having.

    0 讨论(0)
  • 2020-12-02 05:21

    I've been experiencing this annoying problem with PG for years. I created this gist to help.

    The following command always work for me.

    # Substitute Postgres.app/Contents/Versions/9.5 with appropriate version number
    sudo ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config
    

    gist: https://gist.github.com/sharnie/5588340cf023fb177c8d

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