Error installing pg gem on osx

后端 未结 10 886
Happy的楠姐
Happy的楠姐 2020-12-24 15:38

I am on osx 10.6.7 trying to run bundle install on a new rails 3.0.7 app and it keeps failing when trying to build the pg gem. It keeps telling me that I have need the devel

10条回答
  •  一生所求
    2020-12-24 16:04

    Some correction. For those who have installed postgres using homebrew.

    1) write the following line in your ~/.bash_profile

    export ARCHFLAGS="-arch x86_64"

    2) restart console

    3) execute following command

    bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql/9.3.5_1/bin/pg_config (this has to be your pg config address, can differ for each depending on versions of postgres)

    4) Install pg once locally by running this command

    sudo env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/usr/local/Cellar/postgresql/9.3.5_1/bin/pg_config

    5) bundle install

提交回复
热议问题