2

Ruby 1.9 と Rails 3 の新しいコピーを Debian Squeeze サーバーにインストールしました。Rails Web アプリケーションはリモートの Postgres データベースに接続する必要があるため、Postgres アダプターをインストールしようとしましたが、インストーラーがローカルの PostgreSQL データベースと、Postgres データベースが別の場所にあるため、そこにない構成を探しているようです。ホスト。

実際のPostgresデータベースが別のマシンにある場合に、Postgresアダプターをインストールする方法を誰かが説明できますか?

ありがとう

gem1.9.1 install pg


Building native extensions.  This could take a while...
ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again   with
--with-pg-config=/path/to/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.
4

1 に答える 1

1

環境に不足しているライブラリがあります。pggemをインストールする前に、それらをすべてインストールしてみてください。
または、ライブラリがすべてインストールされていても同じエラーが発生する場合は、--with-pg-config上記のエラーが表示されているコマンドで postgres 構成ファイルを指定して gem をインストールしてみてください。

gem install pg --with-pg-config=TYPE_HERE_YOUR_postgresql.conf_PATH
于 2013-02-05T18:57:31.810 に答える