你已经拿破了包 – Postgres gem for rails
因此,当我尝试进行捆绑安装时,我被告知确保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-XY for building a server-side extension or libpq-dev for building a client-side application. You need to install postgresql-server-dev-XY 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 repos禁用。 我做了一个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
- “运行rspec时,无法在任何源中找到pg-0.12.2”
- Rails上的Ruby / PgSQL错误启动:无法加载这样的文件–pg_ext(LoadError)
- Rails + PostgreSQL SSL解密失败
- 为了Heroku,从MySQL切换到PostgreSQL用于Ruby on Rails
- 连接被拒绝(PGError)(postgresql和rails)
- 从Scratch标记:查询数据库问题
- 使用postgres在带轨道的DISTINCT ID中订购
- bundle exec rake assets:precompile – 数据库配置没有指定适配器
- 更好的SQL – :group vs.:select =>’DISTINCT’