2
checking for libpq-fe.h... *** extconf.rb failed ***

問題のようです、それはこの尾からです:

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

        /Users/elephanttrip/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
checking for libpq-fe.h... *** 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.

これを Mountain Lion Mac OS で再現する手順は次のとおりです。

  1. brew install postgresql
  2. env ARCHFLAGS="-arch x86_64" gem install pg

コンピューターを介してさまざまな pg_config を特定しようとしました。Brew の地下室にあるもの、Brew が に cp したもの/user/local、および以前にダウンロードした可能性のある別のもの。それらのどれも機能しません。

アップデート

config-options なしでインストールしようとしました。そして笑った:

ruby extconf.rb --without-pg-config
checking for pg_config... yes
4

1 に答える 1

2

私の問題は、それが言ったトレースの下部としてRVMと関係があると想像し始めました..:

"You need to download development tools"

それから私はしました:

$ rvm autolibs enable
$ rvm requirements

それから先に進み、ルビーを更新しました(これを行わない場合は、現在のものを再インストールすることをお勧めします。これなしでは実行できませんでしたautolibs enable):

$ rvm install ruby-2.0.0-p0

ブーム!解決しました!!!!(:D :D :D :D :D) x 1,000,000

于 2013-04-02T14:18:39.317 に答える