Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Gem Error while installing pg (1.1.3), and Bundler cannot continue

Tags:

I am still fairly new to Rails. I am trying to push to Heroku and I am getting errors.

The first error is when I run a Bundle Install I get this error message:

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

I have tried to run this command

gem install pg -v '1.1.3'

But it fails and gives me this error message:

"ERROR: Error installing pg: ERROR: Failed to build gem native extension."

Does anyone have a solution to this?

like image 885
YankeeJohn Avatar asked Sep 14 '18 21:09

YankeeJohn


1 Answers

I had the exact same problem, and solved it by running sudo apt install postgresql-contrib libpq-dev. Then bundle worked just fine.

like image 145
César Faria Avatar answered Oct 15 '22 07:10

César Faria