Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 安装PostgreSQL Mac OS X Lion时出错_Ruby On Rails 3_Postgresql_Gem - Fatal编程技术网

Ruby on rails 3 安装PostgreSQL Mac OS X Lion时出错

Ruby on rails 3 安装PostgreSQL Mac OS X Lion时出错,ruby-on-rails-3,postgresql,gem,Ruby On Rails 3,Postgresql,Gem,我已经使用RVM安装了ruby和rails,现在正试图通过 Sudo Gem install pg 我所有的其他宝石似乎都安装得很好。这可能是因为我卸载并重新安装了RVM 但是,我得到以下错误 Mikes-MacBook-Air:innoblue Silvis$ sudo gem install pg Building native extensions. This could take a while... ERROR: Error installing pg: ERRO

我已经使用RVM安装了ruby和rails,现在正试图通过

Sudo Gem install pg
我所有的其他宝石似乎都安装得很好。这可能是因为我卸载并重新安装了RVM

但是,我得到以下错误

    Mikes-MacBook-Air:innoblue Silvis$ sudo gem install pg
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

        /Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/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
gcc -I. -I/Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.2.0 -I/Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/Silvis/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/local/Cellar/postgresql/9.1.2/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
gcc -I. -I/Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.2.0 -I/Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/Silvis/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/local/Cellar/postgresql/9.1.2/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:947: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:986: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_prepare’:
pg.c:1052: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_exec_prepared’:
pg.c:1143: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1173: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_s_escape’:
pg.c:1317: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1324: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query’:
pg.c:1497: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1536: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_prepare’:
pg.c:1601: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query_prepared’:
pg.c:1690: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1721: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_wait_for_notify’:
pg.c:2096: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_put_copy_data’:
pg.c:2166: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_block’:
pg.c:2579: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:2585: warning: format not a string literal and no format arguments
pg.c:2600: warning: format not a string literal and no format arguments
pg.c: In function ‘pgconn_locreate’:
pg.c:2863: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘find_or_create_johab’:
pg.c:3933: warning: comparison between signed and unsigned
pg.c:3939: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_client_encoding_as_rb_encoding’:
pg.c:3967: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_rb_encoding_as_pg_encname’:
pg.c:3999: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_internal_encoding_set’:
pg.c:4058: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_external_encoding’:
pg.c:4114: warning: comparison between signed and unsigned
gcc -dynamic -bundle -o pg_ext.bundle compat.o pg.o -L. -L/Users/Silvis/.rvm/rubies/ruby-1.9.2-p290/lib -L/Users/Silvis/.rvm/usr/lib -L. -L/usr/local/lib -L/usr/local/Cellar/postgresql/9.1.2/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  -lruby.1.9.1 -lpq  -lpthread -ldl -lobjc 
ld: file not found: /opt/local/lib/libssl.1.0.0.dylib for architecture x86_64
collect2: ld returned 1 exit status
make: *** [pg_ext.bundle] Error 1


Gem files will remain installed in /Users/Silvis/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.1 for inspection.
Results logged to /Users/Silvis/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.1/ext/gem_make.out

我试过了。我刚让它工作起来。我必须执行brew卸载postgresql,然后brew安装postgresql

我试过了。我刚让它工作起来。我必须执行brew卸载postgresql,然后为OS X 10.7上的用户安装brew postgresqlNote:postgres现在默认安装。在cli上键入psql。当然,你仍然需要宝石。@MikeSilvis,你能把你在评论中提出的解决方案放在一个答案中,这样我就可以投它一票吗?这将从未回答的问题列表中删除此项,您的声誉也会得到一点提升。