Rails错误数据库pg

时间:2015-01-10 16:23:17

标签: ruby-on-rails postgresql

我正在尝试运行bundle install,我收到此错误

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

    /home/aditya/.rvm/rubies/ruby-2.1.3/bin/ruby extconf.rb --with-pg-config=/usr/bin/pg_config
Using config values from /usr/bin/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.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/aditya/.rvm/rubies/ruby-2.1.3/bin/ruby
    --with-pg
    --without-pg
    --with-pg-config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib

extconf failed, exit code 1

Gem files will remain installed in /home/aditya/.rvm/gems/ruby-2.1.3/gems/pg-0.17.1 for inspection.
Results logged to /home/aditya/.rvm/gems/ruby-2.1.3/extensions/x86_64-linux/2.1.0/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.

我目前的Postgre版本是9.3.4

请建议我尝试其他答案,但我无法找到答案。 我试图运行其他命令

bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config  

但我收到了错误

pg: bundle: No such file or directory
pg: config: Is a directory                                                     
pg: build.pg: No such file or directory

我尝试了Can't find the 'libpq-fe.h header when trying to install pg gem的解决方案,但它没有解决我的问题

我也尝试重新安装libpq-dev  获得输出

我尝试重新安装

libqp-dev的

aditya tiwari [12:07 AM] 和输出就像

aditya tiwari [12:07 AM] 阅读包裹清单......完成 建立依赖树
阅读国家信息......完成 推荐套餐:  PostgreSQL的-DOC-9.4 将安装以下新包:  的libpq-dev的

0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 0 B/158 kB of archives.
After this operation, 932 kB of additional disk space will be used.
Selecting previously unselected package libpq-dev.
(Reading database ... 275104 files and directories currently installed.)
Preparing to unpack .../libpq-dev_9.4.0-1.pgdg12.4+1_amd64.deb ...
Unpacking libpq-dev (9.4.0-1.pgdg12.4+1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up libpq-dev (9.4.0-1.pgdg12.4+1) ...

0 个答案:

没有答案