Ruby Can';不要安装pg gem

Ruby Can';不要安装pg gem,ruby,gem,pg,Ruby,Gem,Pg,我在尝试安装pg gem时遇到以下问题。我的操作系统是Ubuntu 12.10。我已经安装了postgresql(通过postgres页面的安装程序)。我还安装了libpq5和libpq-dev。这就是错误: ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/sauronnikko/.rvm/rubies/ruby-1.9.3-p385/bin/ruby ext

我在尝试安装pg gem时遇到以下问题。我的操作系统是Ubuntu 12.10。我已经安装了postgresql(通过postgres页面的安装程序)。我还安装了
libpq5
libpq-dev
。这就是错误:

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

        /home/sauronnikko/.rvm/rubies/ruby-1.9.3-p385/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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
    --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/sauronnikko/.rvm/rubies/ruby-1.9.3-p385/bin/ruby
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib
你能帮我吗?谢谢

sudo apt-get install postgresql
sudo apt-get install libpq-dev
然后

见本页:

$gem install pg--with pg config=/usr/pgsql-9.2/bin/pg_config我认为会有帮助。然而,pg配置路径取决于您安装的postgres版本。它给了我相同的错误。我相信它实际上一直在寻找
pg\u config
,因为它总是说
检查pg\u config。。。是的
,所以我认为这是另外一个错误,或者这对你有帮助吗?是的,这非常有帮助。像这样运行gem install就做到了:
gem install pg--with pg lib=/opt/PostgreSQL/9.2/lib--with pg include=/opt/PostgreSQL/9.2/include
。非常感谢。
bundle install