2012-03-23 23 views
8

pg gemをインストールしようとするとエラーが表示されます。pg gemをインストールする際に問題が発生する

私はrbenv/ruby​​-buildを使ってビルドしたRuby 1.9.3-p125を使用しています。ワンクリックインストーラを使用してPostgreSQLをインストールしました。私はpgAdminを使用してDBに接続することができます。私はアイデアが不足しています。

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

     /Users/sandropadin/.rbenv/versions/1.9.3-p125/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... yes 
checking for PQconnectionUsedPassword()... yes 
checking for PQisthreadsafe()... yes 
checking for PQprepare()... yes 
checking for PQexecParams()... yes 
checking for PQescapeString()... yes 
checking for PQescapeStringConn()... yes 
checking for PQgetCancel()... yes 
checking for lo_create()... yes 
checking for pg_encoding_to_char()... yes 
checking for pg_char_to_encoding()... yes 
checking for PQsetClientEncoding()... yes 
checking for rb_encdb_alias()... yes 
checking for rb_enc_alias()... yes 
checking for struct pgNotify.extra in libpq-fe.h... yes 
checking for unistd.h... yes 
checking for ruby/st.h... yes 
creating extconf.h 
creating Makefile 

make 
compiling pg.c 
compiling pg_connection.c 
pg_connection.c: In function ‘pgconn_wait_for_notify’: 
pg_connection.c:1986: warning: ‘rb_thread_select’ is deprecated (declared at /Users/sandropadin/.rbenv/versions/1.9.3-p125/include/ruby-1.9.1/ruby/intern.h:379) 
pg_connection.c: In function ‘pgconn_block’: 
pg_connection.c:2512: warning: ‘rb_thread_select’ is deprecated (declared at /Users/sandropadin/.rbenv/versions/1.9.3-p125/include/ruby-1.9.1/ruby/intern.h:379) 
compiling pg_result.c 
linking shared-object pg_ext.bundle 
ld: in /usr/local/lib/libssl.0.9.8.dylib, missing required architecture x86_64 in file for architecture x86_64 
collect2: ld returned 1 exit status 
make: *** [pg_ext.bundle] Error 1 


Gem files will remain installed in /Users/sandropadin/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/pg-0.13.2 for inspection. 
Results logged to /Users/sandropadin/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/pg-0.13.2/ext/gem_make.out 
+2

?あなたは32ビットと64ビットのバイナリを混ぜようとしているかもしれません。 –

+0

私は 'brew install openssl'を使用していると思います – Sandro

+0

2つを混在させるのは正しいと思いますが、それが可能かどうか、またはHomebrewがopensslを64ビットとしてビルドするように強制する方法はわかりません – Sandro

答えて

14

最終的にこの問題が解決されたかどうかは不明です。しかし、muが短すぎると言えば、問題は32ビットと64ビットのバイナリを混在させることでした。

  • 第一は、私がこの64-bit version of PostgreSQL
  • 第二をインストールし、私は

    古い自作のOpenSSLのインストールをアンインストール$醸造のアンインストールのopenssl

  • 第三に、私は、64ビット版をインストールHomebrewを使用したOpenSSLのバージョン

    $醸造インストール--64ビットのopenssl

  • 最後に、PGの宝石をインストールするとき、私は、OpenSSL

    の64ビット版を指すようにLDFLAGSを変更

    $宝石はPGをインストールします - --with-LDFLAGS = ' - Lは/ usr/local /セラー/ opensslの/ 0.9.8s' あなたからあなたのlibsslを手に入れた

+1

私はライオンズのコピーを約6ヶ月間コンパイルする 'pg'の宝石を手に入れようと苦労していました。今、この答えが出てきて、私はRails 3.2 + PostgreSQLをチャンピオンのように走らせることができます。ありがとうございました! –

+1

これはMountain Lion、ruby 1.9.3p194(2012-04-20 revision 35410)[x86_64-darwin12.0.0]で私にとって役に立ちました。私は 'brew install postgresql'を使い、すでにopensslを持っていなかったので、' brew install -64-bit openssl'だけで提供したLDFLAGSを使いました。 – thugsb

+0

は素晴らしいですが、opensslのバージョンが(今は1.0.1cで)動いています。ユーザはcd/usr/local/Cellar/openssl /にバージョン番号 –

関連する問題