Error installing pg gem on osx

后端 未结 10 890
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:11

    I had the exact same problem when running bundle install in a Rails app. I installed homebrew and then ran

    brew install postgresql. 
    

    That finally installed postgres correctly and the issue was fixed for me.

    0 讨论(0)
  • 2020-12-24 16:12
    1. export ARCHFLAGS='-arch x86_64'
    2. export PATH=/Library/PostgreSQL/9.1/bin:${PATH}
    3. gem install pg
    0 讨论(0)
  • 2020-12-24 16:14

    The simple solution:

    1. run brew install postgresql
    2. install the gem with sudo permissions: like so: sudo gem install pg -v '0.17.1'
    0 讨论(0)
  • 2020-12-24 16:19

    What worked for me was Zag Zag's comment:

    ~/projects/foo$ env ARCHFLAGS="-arch x86_64" gem install pg
    Building native extensions.  This could take a while...
    Successfully installed pg-0.11.0
    1 gem installed
    Building YARD (yri) index for pg-0.11.0...
    
    ~/projects/foo$ bundle 
    ...
    Using pg (0.11.0) 
    ...
    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
    
    0 讨论(0)
提交回复
热议问题