title: Fail to install pg gem in Rails (using PostgreSQL 9.6)
body: <p>Hi could someone please help me! Appreciate it a lot!</p>
  
  <p>I have some problem bundle install because the terminal says I fail to install gem pg v 0.20.0
  When I tried to install the gem pg this error occurs. I'm currently using PostgreSQL 9.6 I have tried through all the solutions in the similar question but nothing works, including trying to reconfigure pg.</p>
  
  <blockquote>
    <p>198-195:Review minhvu$ gem install pg -- --with-pg-config=/usr/pgsql-9.6/bin/pg_config
    Building native extensions with: '--with-pg-config=/usr/pgsql-9.6/bin/pg_config'
    This could take a while...
    ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.</p>
    
    <p>current directory: /Users/minhvu/.rvm/gems/ruby-2.3.0/gems/pg-0.20.0/ext
    /Users/minhvu/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20170313-7016-1if947v.rb extconf.rb --with-pg-config=/usr/pgsql-9.6/bin/pg_config
    Using config values from /usr/pgsql-9.6/bin/pg_config
    sh: /usr/pgsql-9.6/bin/pg_config: No such file or directory
    sh: /usr/pgsql-9.6/bin/pg_config: No such file or directory
    <strong>* extconf.rb failed *</strong>
    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers.  Check the mkmf.log file for more details.  You may
    need configuration options.</p>
    
    <p>Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/Users/minhvu/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
        --with-pg
        --without-pg
        --enable-windows-cross
        --disable-windows-cross
        --with-pg-config
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/lib
    /Users/minhvu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:456:in <code>try_do': The compiler failed to generate an executable file. (RuntimeError)
    You have to install development tools first.
        from /Users/minhvu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:541:in</code>try_link0'
        from /Users/minhvu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:556:in <code>try_link'
        from extconf.rb:40:in</code>'</p>
    
    <p>To see why this extension failed to compile, please check the mkmf.log which can be found here:</p>
    
    <p>/Users/minhvu/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-16/2.3.0/pg-0.20.0/mkmf.log</p>
    
    <p>extconf failed, exit code 1</p>
    
    <p>Gem files will remain installed in /Users/minhvu/.rvm/gems/ruby-2.3.0/gems/pg-0.20.0 for inspection.
    Results logged to /Users/minhvu/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-16/2.3.0/pg-0.20.0/gem_make.out</p>
  </blockquote>