ERROR: Failed to build gem native extension on Mavericks

后端 未结 11 1004
梦如初夏
梦如初夏 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:37

    You have to configure pg with your current version I used mine 9.4 version on Yosemite. Here is the following command

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

    You should use your own version

    bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/(YOUR POSTGRES VERSION)/bin/pg_config 
    

    then do

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

    An error occurred while installing debugger (1.6.5), and Bundler cannot continue. Make sure that `gem install debugger -v '1.6.5'` succeeds before bundling.

    I was able to fix this error by rolling back to Ruby v2.0.0. I was running Ruby 2.1.1, which is not supported for this debugger version. Be sure to check your ruby version if you run into this issue as well.

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

    When i try to install

    apt-get install libpq-dev
    

    Failed to install, unmet dependencies problem, to solve

    apt-get remove libpq5
    

    then install

    apt-get install libpq-dev
    

    Finally solved the gem pg issue.

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

    I've just got it running by doing

    ARCHFLAGS="-arch x86_64" gem install pg
    

    after installing posgres using brew

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

    The following worked for me:

    gem install pg -v '0.18.1' -- --with-pg config=/Library/PostgreSQL/9.3/bin/pg_config

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