Search code examples
ruby-on-railspostgresqlherokurails-postgresql

pg (0.12.1) not installing on Heroku


I did a bundle update. Now, I am trying to push my app to Heroku and it is not working:

Here is the error that I am getting:

   Installing pg (0.12.1) with native extensions /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

   /usr/ruby1.8.7/bin/ruby extconf.rb 
   checking for pg_config... yes
   Using config values from /usr/bin/pg_config
   checking for libpq-fe.h... yes
   checking for libpq/libpq-fs.h... yes
   checking for PQconnectdb() in -lpq... yes
   checking for PQconnectionUsedPassword()... yes
   checking for PQisthreadsafe()... yes
   checking for PQprepare()... yes
   checking for PQexecParams()... yes
   checking for PQescapeString()... yes
   checking for PQescapeStringConn()... yes
   checking for PQgetCancel()... yes
   checking for lo_create()... yes
   checking for pg_encoding_to_char()... yes
   checking for PQsetClientEncoding()... yes
   checking for rb_encdb_alias()... no
   checking for rb_enc_alias()... no
   checking for struct pgNotify.extra in libpq-fe.h... yes
   checking for unistd.h... yes
   checking for ruby/st.h... no
   pg currently requires the ruby/st.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=/usr/ruby1.8.7/bin/ruby
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pqlib
    --without-pqlib
    --enable-static-build
    --disable-static-build


   Gem files will remain installed in /disk1/tmp/build_2ss3rr1i4kv9j/.bundle/gems/ruby/1.8/gems/pg-0.12.1 for inspection.
   Results logged to /disk1/tmp/build_2ss3rr1i4kv9j/.bundle/gems/ruby/1.8/gems/pg-0.12.1/ext/gem_make.out
    from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
    from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
    from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `run'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `send'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13
    from /usr/ruby1.8.7/bin/bundle:19:in `load'
    from /usr/ruby1.8.7/bin/bundle:19
   FAILED: http://devcenter.heroku.com/articles/bundler

! Heroku push rejected, failed to install gems via Bundler

Any ideas? Thanks in advance!


Solution

  • There was a bug in 0.12.1 with Ruby 1.8, 0.12.2 works great now.