ruby - Can not install gem 'pg' to deploy rails app to heroku -


i trying deploy rails app heroku , have replaced gem 'sqlite3' gem 'pg'. have done because getting error trying push git heroku saying sqlite3 not supported. whenever try run bundle install error.

gem::ext::builderror: error: failed build gem native extension.      /users/ipbyrne/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150722-14766-1b3cg9.rb extconf.rb checking pg_config... no no pg_config... trying anyway. if building fails, please try again  --with-pg-config=/path/to/pg_config checking libpq-fe.h... no can't find 'libpq-fe.h header *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers.  check mkmf.log file more details.  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/ipbyrne/.rvm/rubies/ruby-2.2.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  extconf failed, exit code 1  gem files remain installed in /users/ipbyrne/.rvm/gems/ruby-2.2.1/gems/pg-0.18.2 inspection. results logged /users/ipbyrne/.rvm/gems/ruby-2.2.1/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.2/gem_make.out error occurred while installing pg (0.18.2), , bundler cannot continue. make sure `gem install pg -v '0.18.2'` succeeds before bundling. 

here gemfile looks like

source 'https://rubygems.org'   # bundle edge rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.0'  # use sqlite3 database active record gem 'pg'  # use scss stylesheets gem 'sass-rails', '~> 4.0.0'  # use uglifier compressor javascript assets gem 'uglifier', '>= 1.3.0'  # use coffeescript .js.coffee assets , views gem 'coffee-rails', '~> 4.0.0'  # see https://github.com/sstephenson/execjs#readme more supported runtimes # gem 'therubyracer', platforms: :ruby  # use jquery javascript library gem 'jquery-rails'  # turbolinks makes following links in web application faster. read more: https://github.com/rails/turbolinks gem 'turbolinks'  # build json apis ease. read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 1.2'  group :doc   # bundle exec rake doc:rails generates api under doc/api.   gem 'sdoc', require: false end  gem 'devise', '~> 3.3.0'  gem 'bootstrap-sass', '~> 3.2.0.2'  gem 'acts_as_votable', '~> 0.10.0'  gem 'simple_form', '~>3.0.2'   # use activemodel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0'  # use unicorn app server # gem 'unicorn'  # use capistrano deployment # gem 'capistrano', group: :development  # use debugger # gem 'debugger', group: [:development, :test] 

and here error whenever try manually install gem running 'gem install pg -v '0.18.2' says @ end of first error.

building native extensions.  take while... error:  error installing pg:     error: failed build gem native extension.      /users/ipbyrne/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150722-14778-10kqj2o.rb extconf.rb checking pg_config... no no pg_config... trying anyway. if building fails, please try again  --with-pg-config=/path/to/pg_config checking libpq-fe.h... no can't find 'libpq-fe.h header *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers.  check mkmf.log file more details.  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/ipbyrne/.rvm/rubies/ruby-2.2.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  extconf failed, exit code 1  gem files remain installed in /users/ipbyrne/.rvm/gems/ruby-2.2.1/gems/pg-0.18.2 inspection. results logged /users/ipbyrne/.rvm/gems/ruby-2.2.1/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.2/gem_make.out 

you're missing development headers come in libpq-dev package. needs installed through whatever package manager use (or if you're using mac can brew install postgresql)


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -