ERROR: Failed to build gem native extension on Mavericks

后端 未结 11 1003
梦如初夏
梦如初夏 2020-11-29 07:43

I\'m attempting to run bundle in my Rails project on OSX 10.9. It fails when getting to the pg gem with this error:

Gem::Installer:         


        
相关标签:
11条回答
  • 2020-11-29 08:27

    this worked for me with Mavericks and the Postgresapp:

    gem install pg -v '0.17.0' -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config
    
    0 讨论(0)
  • 2020-11-29 08:28

    For me using Mavericks, Rails 3.2.13, Ruby 2.0.0-p247, PostgreSQL 9.1, I needed todo this:

    gem install pg -v '0.15.1' -- --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config
    
    0 讨论(0)
  • 2020-11-29 08:30

    For me it worked when I did:

    brew install postgresql
    
    0 讨论(0)
  • 2020-11-29 08:30

    This worked for me on Mac OS X 10.9.3 and Postgres.app version 9.3.4.2:

    1) Install Postgres.app

    2) bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config

    3) gem install pg -v '0.17.1'

    4) bundle install

    0 讨论(0)
  • 2020-11-29 08:33

    Try using the --with-pg-config argument:

    bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config
    

    To show the path of the pg_config:

    which pg_config
    

    For Ubuntu users:

    sudo apt-get install postgresql
    sudo apt-get install libpq-dev
    

    Then:

    bundle install
    
    0 讨论(0)
  • 2020-11-29 08:35

    Also make sure that you've upgraded Xcode to re-install command line tools on Mavericks. In terminal type:

    xcode-select --install
    

    Then follow the prompts.

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