Am I having trouble clicking on my rail application in Heroku / getting a "pg" gem to install?

Initially, I could not push my rails 4 application to heroku because my database was sqlite, and so now I am trying to install Gem Postgresql ('pg'), but I'm out of luck. This is the error message that I receive in my terminal after starting the installation of the package:

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 *** 

After running gem install pg -v '0.17.1' --with-pg-config

I get this error in my terminal:

 ERROR: While executing gem ... (Gem::Requirement::BadRequirementError) Illformed requirement ["0.17.1--with-pg_config"] /project$ gem install pg -v '0.17.1'--with-pg-config ERROR: Could not find a valid gem 'pg' (= 0.17.1.pre..pre.with.pre.pg.pre.config) in any repository ERROR: Possible alternatives: pg 

Thanks for the help.

+1
ruby ruby-on-rails postgresql deployment heroku
source share
1 answer

If you do not have postgres installed , you may need to:

 sudo apt-get install postgresql sudo apt-get install libpq-dev 

following gem install pg and bundle .

If you have postgres installed and running gem install pg does not work, you need to run which pg_config to get the path to your pg_config and run gem install pg -- --with-pg-config= output_from_previous_command .

+3
source share

All Articles