Last active
          September 7, 2025 13:07 
        
      - 
      
 - 
        
Save tomholford/f38b85e2f06b3ddb9b4593e841c77c9e to your computer and use it in GitHub Desktop.  
Revisions
- 
        
tomholford revised this gist
Jan 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ checking for libpq-fe.h... no Can't find the 'libpq-fe.h header ``` The following helped me resolve the issue without having to install the entire postgresql as recommended in [the stop Stack Overflow post](https://stackoverflow.com/a/6040822) (already using it in a Docker container): 1. `brew install libpq` 2. `gem install pg -- --with-pg-config=/usr/local/opt/libpq/bin/pg_config`  - 
        
tomholford renamed this gist
Jan 25, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. - 
        
tomholford created this gist
Jan 25, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Installing `pg` gem on macOS If you're trying to install the postgresql gem `pg` and it is failing with the following error message: ``` Installing pg 1.2.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: ~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/pg-1.2.3/ext ~/.rbenv/versions/3.0.0/bin/ruby -I ~/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210125-97201-pycpo.rb extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header ``` The following helped me resolve the issue without having to install the entire postgresql as recommended in the stop Stack Overflow post (already using it in a Docker container): 1. `brew install libpq` 2. `gem install pg -- --with-pg-config=/usr/local/opt/libpq/bin/pg_config`