简体   繁体   English

捆绑安装以解决pg宝石无尽错误

[英]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. 因此,我处于一个项目阶段,在此之前我需要为Rails添加“ pg” gem,然后才能部署到Heroku,当然,我不断出错。 When I first did your basic bundle install I got the errors: 第一次安装基本捆绑软件时,出现以下错误:

ERROR: Error installing pg: ERROR: Failed to build gem native extension. 错误:安装pg时出错:错误:无法生成gem本机扩展。

Can't find the 'libpq-fe.h header * extconf.rb failed * 找不到'libpq-fe.h标头* extconf.rb失败*

An error occurred while installing pg (0.21.0), and Bundler cannot continue. 安装pg(0.21.0)时发生错误,并且Bundler无法继续。 Make sure that gem install pg -v '0.21.0' succeeds before bundling. 捆绑之前,请确保gem install pg -v '0.21.0'成功。

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 我认为您可以在这里找到答案: 无法在Rails上安装pg gem

You should probably install the PostgreSQL development libraries. 您可能应该安装PostgreSQL开发库。

If you're on Ubuntu this will help: 如果您使用的是Ubuntu,这将有所帮助:

sudo apt-get install libpq-dev

On a Mac: 在Mac上:

brew install postgresql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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