Using PGsql App on OSX for the first time for a rails app and the app is not utilizing the server

Spent a pomodoro searching how to set get my PGSQL working for a new app. I tried installing the PG gem but that didn't work either.

When I try to 'bundle install' I get this error, which is confusing because the app was able to see other gems when installing.

Aris-MBP:~ arikalmen$ bundle install
Could not locate Gemfile
Aris-MBP:~ arikalmen$

Below is the printout of the error when I tried to build the new app using this command:

rails new toy_app -T --database=postgresql

Please advise on any other details that would be helpful in resolving this issue!

Using rb-fsevent 0.10.2
Using rb-inotify 0.9.10
Using ruby_dep 1.5.0
Using listen 3.1.5


Fetching pg 0.21.0
Installing pg 0.21.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/arikalmen/.rvm/gems/ruby-2.4.1/gems/pg-0.21.0/ext
/Users/arikalmen/.rvm/rubies/ruby-2.4.1/bin/ruby -r
./siteconf20180111-3506-6wt3pv.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
*** extconf.rb failed ***
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.

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/arikalmen/.rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
    --with-pg
    --without-pg
    --enable-windows-cross
    --disable-windows-cross
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-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

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/Users/arikalmen/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-17/2.4.0/pg-0.21.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/Users/arikalmen/.rvm/gems/ruby-2.4.1/gems/pg-0.21.0 for inspection.
Results logged to
/Users/arikalmen/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-17/2.4.0/pg-0.21.0/gem_make.out

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

In Gemfile:
  pg
         run  bundle exec spring binstub --all
Could not find gem 'pg (~> 0.18)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

update

I entered the app directory and ran bundle update and the message to gem install pg pasting below the output.

Aris-MBP:~ arikalmen$ cd toy_app/
Aris-MBP:toy_app arikalmen$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.0
Using concurrent-ruby 1.0.5
Using i18n 0.9.1
Using minitest 5.11.1
Using thread_safe 0.3.6
Using tzinfo 1.2.4
Using activesupport 5.1.4
Using builder 3.2.3
Using erubi 1.7.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.1
Using rails-dom-testing 2.0.3
Using crass 1.0.3
Using loofah 2.1.1
Using rails-html-sanitizer 1.0.3
Using actionview 5.1.4
Using rack 2.0.3
Using rack-test 0.8.2
Using actionpack 5.1.4
Using nio4r 2.2.0
Using websocket-extensions 0.1.3
Using websocket-driver 0.6.5
Using actioncable 5.1.4
Using globalid 0.4.1
Using activejob 5.1.4
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.1.4
Using activemodel 5.1.4
Using arel 8.0.0
Using activerecord 5.1.4
Using bindex 0.5.0
Using bundler 1.16.1
Using byebug 9.1.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using method_source 0.9.0
Using thor 0.20.0
Using railties 5.1.4
Using coffee-rails 4.2.2
Using ffi 1.9.18
Using multi_json 1.13.1
Using jbuilder 2.7.0
Using rb-fsevent 0.10.2
Using rb-inotify 0.9.10
Using ruby_dep 1.5.0
Using listen 3.1.5
Fetching pg 0.21.0
Installing pg 0.21.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/arikalmen/.rvm/gems/ruby-2.4.1/gems/pg-0.21.0/ext
/Users/arikalmen/.rvm/rubies/ruby-2.4.1/bin/ruby -r
./siteconf20180111-3601-o3tm9n.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
*** extconf.rb failed ***
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.

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/arikalmen/.rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
    --with-pg
    --without-pg
    --enable-windows-cross
    --disable-windows-cross
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-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

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/Users/arikalmen/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-17/2.4.0/pg-0.21.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/Users/arikalmen/.rvm/gems/ruby-2.4.1/gems/pg-0.21.0 for inspection.
Results logged to
/Users/arikalmen/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-17/2.4.0/pg-0.21.0/gem_make.out

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

In Gemfile:
  pg
Aris-MBP:toy_app arikalmen$ gem install pg -v '0.21.0'
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    current directory: /Users/arikalmen/.rvm/gems/ruby-2.4.1/gems/pg-0.21.0/ext
/Users/arikalmen/.rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180111-3624-14qcagr.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
*** extconf.rb failed ***
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.

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/arikalmen/.rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
    --with-pg
    --without-pg
    --enable-windows-cross
    --disable-windows-cross
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-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

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/arikalmen/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-17/2.4.0/pg-0.21.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/arikalmen/.rvm/gems/ruby-2.4.1/gems/pg-0.21.0 for inspection.
Results logged to /Users/arikalmen/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-17/2.4.0/pg-0.21.0/gem_make.out
Aris-MBP:toy_app arikalmen$