因此,当我尝试进行捆绑安装时,我被告知要确保成功安装 pg gem,所以当我执行 gem install pg vx.xx
时我得到:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/home/adam/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
那么我这样做:
sudo apt-get install libpq-dev
但我明白了
The following packages have unmet dependencies:
libpq-dev : Depends: libpq5 (= 9.1.14-0ubuntu0.12.04) but 9.3.5-1.pgdg12.4+1 is to be installed
E: Unable to correct problems, you have held broken packages.
因此,我从 postgres 和 pgadmin 安装了 9.1 的所有其他内容,并且禁用了任何 9.3 存储库。我做了一个
sudo apt-get update
但我认为错误非常明显。那么如何让它不尝试安装 9.3.5 .... 并使用 9.1.14?
最佳答案
我刚刚遇到了这个问题。我在这里找到了解决方案:http://blog.andrewbeacock.com/2007/03/how-to-install-specific-version-of.html
本质上:
$: apt-get install libpq5=9.1.14-0ubuntu0.12.04
$: apt-get install libpq-dev=9.1.14-0ubuntu0.12.04
$: apt-get install postgresql-server-dev-9.1
关于ruby-on-rails - 您持有破损的包裹 - 用于 Rails 的 Postgres gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25393203/