-1

尝试运行时,pattern_create.rb我收到一条rake-10.4.2缺少的错误消息,我需要运行捆绑安装。

运行 bundle install 它一直运行,直到pg使用本机扩展安装 (0.18.1) 会导致错误:

Gem::Installer::ExtensionBuildError: 错误: 无法构建 gem 原生扩展。

有人告诉我:

您需要安装 postgresql-server-dev-XY 来构建服务器端扩展或 libpq-dev 来构建客户端应用程序。您需要安装 postgresql-server-dev-XY 来构建服务器端扩展或 libpq-dev 来构建客户端应用程序。

我尝试了以下方法:sudo apt-get install postgresql-9.1,然后 sudo apt-get install python-psycopg2sudo apt-get install libpq-dev

最后一条指令以:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

以下包具有未满足的依赖项:

libpq-dev : 
     Depends: libpq5 (= 9.1.14-0+deb7u1) but 9.1.15-0+deb7u1 is to be installed
     Depends: libkrb5-dev but it is not going to be installed
     Depends: comerr-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

之后再次运行sudo bundle install仍然会导致相同的错误。我错过了什么?

4

1 回答 1

0

实际上并没有解决为什么捆绑安装不起作用,我在 Stackoverflow 上找到了这个:捆绑和耙的 Metasploit 归纳

Aj 和 Mahendra 的解决方案让我跑了pattern_create.rb

于 2015-07-08T03:21:58.483 回答