Rails - 安装 pg (1.1.3) 时出现 Gem 错误,并且 Bundler 无法继续 [英] Rails - Gem Error while installing pg (1.1.3), and Bundler cannot continue

查看:43
本文介绍了Rails - 安装 pg (1.1.3) 时出现 Gem 错误,并且 Bundler 无法继续的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Rails 还是比较陌生.我正在尝试推送到 Heroku,但出现错误.

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:

"安装 pg (1.1.3) 时出错,Bundler 无法继续.在打包前确保 gem install pg -v '1.1.3' 成功."

"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."

我已尝试运行此命令

gem install pg -v '1.1.3'

但它失败了并给了我这个错误信息:

But it fails and gives me this error message:

"错误:安装 pg 时出错:错误:无法构建 gem 本机扩展."

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

有没有人有办法解决这个问题?

Does anyone have a solution to this?

推荐答案

尝试使用 pg-config 安装,如下所示:
gem install pg -v 1.1.3 -- --with-pg-config=/usr/pgsql-9.X/bin/pg_config.

try instaling with pg-config like this:
gem install pg -v 1.1.3 -- --with-pg-config=/usr/pgsql-9.X/bin/pg_config.

在 pg-config 路径中​​提及您系统中安装的 posgtres 版本.

In pg-config path mention the posgtres version installed in you're system.

这篇关于Rails - 安装 pg (1.1.3) 时出现 Gem 错误,并且 Bundler 无法继续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆