1

だから、私はRails(そして必要なgem)を正しくインストールするために一日の大部分を費やしました。

ラインキャッシュとnokogiriを何時間も使用した後、私は疲れ果てたと感じ始めており、「pg」ジェムのインストールで問題が発生しました。

私は戦い続けるつもりですが、この問題についてここで何かアドバイスはありますか?

(1つのSO投稿で2つの質問をするべきではないことはわかっていますが、とにかく行きます。過去に大量のソフトウェアをインストールしたことがあり(Linuxカーネルを最初からコンパイルすることを含む)、Railsをインストールするのは非常に難しいようです。 Snow Leopard。古き良き時代にLinuxディスプレイドライバを動作させるのと同じくらいです。このプロセスをより簡単にするためにどこかで進歩はありますか?)

エラーログは次のとおりです。

Using linecache19 (0.5.12) 
Installing nokogiri (1.5.0) with native extensions 
Installing pg (0.12.2) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/user/.rvm/rubies/ruby-1.9.2-p318/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 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 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
/usr/bin/gcc-4.2 -I. -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/ruby/backward -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/user/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/include -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -o compat.o -c compat.c
/usr/bin/gcc-4.2 -I. -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/ruby/backward -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/user/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/include -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -o pg.o -c pg.c
pg.c: In function ‘pgconn_exec’:
pg.c:954: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:993: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_prepare’:
pg.c:1059: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_exec_prepared’:
pg.c:1150: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1180: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_s_escape’:
pg.c:1324: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1331: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query’:
pg.c:1504: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1543: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_prepare’:
pg.c:1608: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query_prepared’:
pg.c:1697: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1728: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_wait_for_notify’:
pg.c:2103: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_put_copy_data’:
pg.c:2173: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_block’:
pg.c:2586: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:2592: warning: format not a string literal and no format arguments
pg.c:2607: warning: format not a string literal and no format arguments
pg.c: In function ‘pgconn_locreate’:
pg.c:2870: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘find_or_create_johab’:
pg.c:3940: warning: comparison between signed and unsigned
pg.c:3946: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_client_encoding_as_rb_encoding’:
pg.c:3974: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_rb_encoding_as_pg_encname’:
pg.c:4006: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_internal_encoding_set’:
pg.c:4065: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_external_encoding’:
pg.c:4121: warning: comparison between signed and unsigned
/usr/bin/gcc-4.2 -dynamic -bundle -o pg_ext.bundle compat.o pg.o -L. -L/Users/user/.rvm/rubies/ruby-1.9.2-p318/lib -L/Users/user/.rvm/usr/lib -L. -L/usr/local/lib -L/usr/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  -lruby.1.9.1 -lpq  -lpthread -ldl -lobjc 
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/user/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.12.2 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.12.2/ext/gem_make.out
An error occured while installing pg (0.12.2), and Bundler cannot continue.
Make sure that `gem install pg -v '0.12.2'` succeeds before bundling.
4

2 に答える 2

1

このプロセスをより簡単にすることに関して、どこかで進展はありますか?)

はい:Yehuda KatzはKickstarterプロジェクトを主導して支援しています: http ://www.kickstarter.com/projects/1397300529/railsapp

古いopensslがあるようです。

これを試して:

sudo port selfupdate

古いポートのリストを表示します。

port outdated

古いポートをクリーンアップします。

sudo port clean outdated
sudo port upgrade outdated

libsslがあるかどうかを確認します。

find / | grep libssl.*dylib

Macのダウンロードからpostgresqlをインストールしてみてください。

http://www.postgresql.org/download/macosx/

次に、通常どおりにgemをインストールしてみてください。

gem install pg

または、sudoを使用する場合は、次のようにします。

sudo gem install pg
于 2012-04-03T13:06:53.767 に答える
0

通常、これは64ビット/32ビットの問題です。rubyバージョンとPostgresqlインストールの不一致。アーキテクチャに応じて、正しいARCHフラグを使用する必要があります。

stackoverflowでこの回答をご覧ください。

一般的に、「自作」とRVMの使用にはほとんど問題がありません。

HTH

于 2012-04-03T13:03:24.233 に答える