简体   繁体   English

没有PostgreSQL的bundle安装失败

[英]bundle install fails without postgresql

When I run bundle install I get this error: 当我运行bundle install此错误:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /usr/local/lib/ruby/gems/2.3.0/gems/pg-0.18.4/ext
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160601-64492-1nt86nq.rb extconf.rb
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 ***

Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

... [a long list of config options] ...

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

Then when I try gem install pg -v '0.18.4' like it suggests I get the same error without the suggestion to run the command I just tried. 然后,当我尝试使用gem install pg -v '0.18.4' ,它提示我得到相同的错误,但没有建议运行我刚刚尝试过的命令。 I'm not running postgres and have never installed it, so I'm a bit confused about why this is happening. 我没有运行postgres,也从未安装过它,所以对于为什么会发生这种情况我有些困惑。

There is a similar question here, but again, I don't have postgresql. 这里有一个类似的问题,但是同样,我没有postgresql。 Do I need it? 我需要吗? Question: gem install pg -v 0.12.2 error on mac 问题: 在Mac上gem install pg -v 0.12.2错误

Any help is appreciated. 任何帮助表示赞赏。 Thank you. 谢谢。

Yes, in order to install the pg gem you must have postgresql installed. 是的,为了安装pg gem,您必须安装了postgresql。 You can find downloads and install instruction on their website . 您可以在其网站上找到下载并安装说明。

Specifically it says you need a pg_config file, which I guess would be created upon installation. 具体来说,它说您需要一个pg_config文件,我猜该文件将在安装时创建。

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

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