Can't find the 'libpq-fe.h header when trying to install pg gem

前端 未结 30 1880
深忆病人
深忆病人 2020-11-22 07:47

I am using the Ruby on Rails 3.1 pre version. I like to use PostgreSQL, but the problem is installing the pg gem. It gives me the following error:



        
30条回答
  •  迷失自我
    2020-11-22 08:14

    On macOS (previously Mac OS X and OS X), use Homebrew to install the proper headers:

    brew install postgresql
    

    and then running

    gem install pg
    

    should work.

    Alternatively, instead of installing the whole postgresql, you can brew install libpq and export the correct PATH and PKG_CONFIG_PATH as explained in the 'Caveats' section

提交回复
热议问题