简体   繁体   中英

Bundle install for 'pg' gem endless errors

So I'm at the stage of a project where I need to add the 'pg' gem for rails before I can deploy to Heroku, and of course I keep getting error after error. When I first did your basic bundle install I got the errors:

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

Can't find the 'libpq-fe.h header * extconf.rb failed *

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

If I try as it suggests with the last sentence, it just repeats the same set of errors.

Hoping there is a simple fix so I can move forward to my next error! Any and all suggestions are appreciated from this newbie developer.

I think you can find the answer here: Can't install pg gem on Rails

You should probably install the PostgreSQL development libraries.

If you're on Ubuntu this will help:

sudo apt-get install libpq-dev

On a Mac:

brew install postgresql

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM