title: Heroku/postgres error
body: <p>I am trying to deploy a ruby on rails app to Heroku and am getting and an error.  I have followed the tutortial and added postgres to my gem file but when I try to "git push heroku master" I get the following error:</p>
  
  <p><em><strong></em></strong> Output <strong>**</strong></p>
  
  <pre><code>id: treebook $ git push heroku master
  Counting objects: 297, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (271/271), done.
  Writing objects: 100% (297/297), 109.43 KiB | 0 bytes/s, done.
  Total 297 (delta 116), reused 0 (delta 0)
  
  -----&gt; Ruby/Rails app detected
  -----&gt; Using Ruby version: ruby-2.0.0
  -----&gt; Installing dependencies using Bundler version 1.3.2
         New app detected loading default bundler cache
         Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
         You are trying to install in deployment mode after changing
         your Gemfile. Run `bundle install` elsewhere and add the
         updated Gemfile.lock to version control.
         You have added to the Gemfile:
         * pg
         Bundler Output: You are trying to install in deployment mode after changing
         your Gemfile. Run `bundle install` elsewhere and add the
         updated Gemfile.lock to version control.
  
         You have added to the Gemfile:
         * pg
   !
   !     Failed to install gems via Bundler.
   !
  
   !     Push rejected, failed to compile Ruby/Rails app
  
  To git@heroku.com:aqueous-headland-9388.git
   ! [remote rejected] master -&gt; master (pre-receive hook declined)
  error: failed to push some refs to 'git@heroku.com:aqueous-headland-9388.git'
  </code></pre>
  
  <hr>
  
  <p>It tells me to 'bundle install' and when I do that I get:</p>
  
  <p><em><strong></em></strong> Output <strong>**</strong></p>
  
  <pre><code>...
  Using devise (3.1.1) 
  Using jquery-rails (3.0.4) 
  Installing pg (0.17.0) 
  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  
      /Users/tithos/.rvm/rubies/ruby-2.0.0-p247/bin/ruby 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
      --without-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/tithos/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
      --with-pg
      --without-pg
      --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}/
  
  
  Gem files will remain installed in /Users/tithos/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.0 for inspection.
  Results logged to /Users/tithos/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.0/ext/gem_make.out
  
  An error occurred while installing pg (0.17.0), and Bundler cannot continue.
  Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.
  </code></pre>
  
  <hr>
  
  <p>When I try <code>gem install pg -v '0.17.0'</code> I get:</p>
  
  <p><em><strong></em></strong> Output <strong>**</strong></p>
  
  <pre><code>id: treebook $ gem install pg -v '0.17.0'
  Building native extensions.  This could take a while...
  ERROR:  Error installing pg:
      ERROR: Failed to build gem native extension.
  
      /Users/tithos/.rvm/rubies/ruby-2.0.0-p247/bin/ruby 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
      --without-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/tithos/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
      --with-pg
      --without-pg
      --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}/
  
  Gem files will remain installed in /Users/tithos/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.0 for inspection.
  Results logged to /Users/tithos/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.0/ext/gem_make.out
  </code></pre>
  
  <hr>
  
  <p>I am totally lost.  Any help would be great.</p>
  
  <p>I tried 'brew install postgresql' and got:</p>
  
  <pre><code>id: treebook $ brew install postgresql
  Warning: It appears you have MacPorts or Fink installed.
  Software installed with other package managers causes known problems for
  Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
  ==&gt; Downloading http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar
  ######################################################################## 100.0%
  ==&gt; Patching
  patching file src/pl/plpython/Makefile
  patching file contrib/uuid-ossp/uuid-ossp.c
  ==&gt; ./configure --prefix=/usr/local/Cellar/postgresql/9.2.4 --datadir=/usr/local
  checking for POSIX signal interface... yes
  checking for working memcmp... yes
  checking for tclsh... /usr/bin/tclsh
  checking for tclConfig.sh... no
  configure: error: file 'tclConfig.sh' is required for Tcl
  Error: Homebrew doesn't know what compiler versions ship with your version
  of Xcode (5.0.1). Please `brew update` and if that doesn't help, file
  an issue with the output of `brew --config`:
    https://github.com/mxcl/homebrew/issues
  
  Thanks!
  
  READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
  
  These open issues may also help:
      https://github.com/mxcl/homebrew/issues/23178
  id: treebook $ brew update
  error: The following untracked working tree files would be overwritten by merge:
      Library/Formula/spim.rb
  Please move or remove them before you can merge.
  Aborting
  Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
  </code></pre>