Ruby gem是否在MAC 10.7.5上安装pg?
这只是关于同一个问题的另一个线索。如何安装gem pg。我尝试了stackoverflow上发现的几乎所有其他线程,但都不起作用 我尝试通过brew和dmg软件包安装postgress。结果是同样的错误Ruby gem是否在MAC 10.7.5上安装pg?,ruby,postgresql,rubygems,Ruby,Postgresql,Rubygems,这只是关于同一个问题的另一个线索。如何安装gem pg。我尝试了stackoverflow上发现的几乎所有其他线程,但都不起作用 我尝试通过brew和dmg软件包安装postgress。结果是同样的错误 Xcode Verion: 4.6 Rails Version: 4.0.0 Ruby Version: ruby-2.0.0-p247: $ gcc --version i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple
Xcode Verion: 4.6
Rails Version: 4.0.0
Ruby Version: ruby-2.0.0-p247:
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/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... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Gem files will remain installed in /Users/arturo/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0 for inspection.
Results logged to /Users/arturo/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0/ext/gem_make.out
$ cat /Users/arturo/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0/ext/mkmf.log
find_executable: checking for pg_config... -------------------- yes
--------------------
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -lruby.2.0.0 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -lruby.2.0.0 -Wl,-rpath,/usr/lib -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
find_header: checking for libpq-fe.h... -------------------- yes
"/usr/bin/clang -E -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
/* end */
--------------------
find_header: checking for libpq/libpq-fs.h... -------------------- yes
"/usr/bin/clang -E -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq/libpq-fs.h>
/* end */
--------------------
find_header: checking for pg_config_manual.h... -------------------- yes
"/usr/bin/clang -E -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <pg_config_manual.h>
/* end */
--------------------
have_library: checking for PQconnectdb() in -lpq... -------------------- no
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -Wl,-rpath,/usr/lib -lruby.2.0.0 -lpq -lpthread -ldl -lobjc "
Undefined symbols for architecture x86_64:
"_CRYPTO_num_locks", referenced from:
_pqsecure_initialize in libpq.a(fe-secure.o)
"_CRYPTO_set_id_callback", referenced from:
_pqsecure_destroy in libpq.a(fe-secure.o)
_pqsecure_initialize in libpq.a(fe-secure.o)
"_CRYPTO_set_locking_callback", referenced from:
_pqsecure_destroy in libpq.a(fe-secure.o)
_pqsecure_initialize in libpq.a(fe-secure.o)
"_ENGINE_by_id", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_ENGINE_finish", referenced from:
_close_SSL in libpq.a(fe-secure.o)
_pqsecure_open_client in libpq.a(fe-secure.o)
"_ENGINE_free", referenced from:
_close_SSL in libpq.a(fe-secure.o)
_pqsecure_open_client in libpq.a(fe-secure.o)
"_ENGINE_init", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_ENGINE_load_private_key", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_ERR_get_error", referenced from:
_SSLerrmessage in libpq.a(fe-secure.o)
"_ERR_reason_error_string", referenced from:
_SSLerrmessage in libpq.a(fe-secure.o)
"_GSS_C_NT_HOSTBASED_SERVICE", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_OPENSSL_config", referenced from:
_pqsecure_initialize in libpq.a(fe-secure.o)
"_SSL_CTX_ctrl", referenced from:
_pqsecure_initialize in libpq.a(fe-secure.o)
"_SSL_CTX_get_cert_store", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_CTX_load_verify_locations", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_CTX_new", referenced from:
_pqsecure_initialize in libpq.a(fe-secure.o)
"_SSL_CTX_use_certificate_chain_file", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_check_private_key", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_connect", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_free", referenced from:
_close_SSL in libpq.a(fe-secure.o)
"_SSL_get_error", referenced from:
_pqsecure_write in libpq.a(fe-secure.o)
_pqsecure_read in libpq.a(fe-secure.o)
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_get_peer_certificate", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_library_init", referenced from:
_pqsecure_initialize in libpq.a(fe-secure.o)
"_SSL_load_error_strings", referenced from:
_pqsecure_initialize in libpq.a(fe-secure.o)
"_SSL_new", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_pending", referenced from:
_pqSocketCheck in libpq.a(fe-misc.o)
"_SSL_read", referenced from:
_pqsecure_read in libpq.a(fe-secure.o)
"_SSL_set_ex_data", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_set_fd", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_set_verify", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_shutdown", referenced from:
_close_SSL in libpq.a(fe-secure.o)
"_SSL_use_PrivateKey", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_use_PrivateKey_file", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_use_certificate_file", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_SSL_write", referenced from:
_pqsecure_write in libpq.a(fe-secure.o)
"_TLSv1_method", referenced from:
_pqsecure_initialize in libpq.a(fe-secure.o)
"_X509_NAME_get_text_by_NID", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_X509_NAME_oneline", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_X509_STORE_load_locations", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_X509_STORE_set_flags", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_X509_free", referenced from:
_close_SSL in libpq.a(fe-secure.o)
"_X509_get_subject_name", referenced from:
_pqsecure_open_client in libpq.a(fe-secure.o)
"_error_message", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_gss_delete_sec_context", referenced from:
_closePGconn in libpq.a(fe-connect.o)
_pg_GSS_continue in libpq.a(fe-auth.o)
"_gss_display_status", referenced from:
_pg_GSS_error_int in libpq.a(fe-auth.o)
"_gss_import_name", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_gss_init_sec_context", referenced from:
_pg_GSS_continue in libpq.a(fe-auth.o)
"_gss_release_buffer", referenced from:
_closePGconn in libpq.a(fe-connect.o)
_pg_GSS_error_int in libpq.a(fe-auth.o)
_pg_GSS_continue in libpq.a(fe-auth.o)
"_gss_release_name", referenced from:
_closePGconn in libpq.a(fe-connect.o)
_pg_GSS_continue in libpq.a(fe-auth.o)
"_krb5_cc_close", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
_pg_krb5_destroy in libpq.a(fe-auth.o)
"_krb5_cc_default", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_krb5_cc_get_principal", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_krb5_free_context", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
_pg_krb5_destroy in libpq.a(fe-auth.o)
"_krb5_free_error", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_krb5_free_principal", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
_pg_krb5_destroy in libpq.a(fe-auth.o)
"_krb5_free_unparsed_name", referenced from:
_pg_krb5_destroy in libpq.a(fe-auth.o)
"_krb5_init_context", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_krb5_sendauth", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_krb5_sname_to_principal", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_krb5_unparse_name", referenced from:
_pg_fe_sendauth in libpq.a(fe-auth.o)
"_ldap_count_entries", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_err2string", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_first_entry", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_get_values_len", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_init", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_msgfree", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_result", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_search_st", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_simple_bind", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_unbind", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
"_ldap_value_free_len", referenced from:
_parseServiceFile in libpq.a(fe-connect.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
/* end */
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -Wl,-rpath,/usr/lib -lruby.2.0.0 -lpq -lpthread -ldl -lobjc "
conftest.c:7:27: error: too few arguments to function call, single argument 'conninfo' was not specified
int t(void) { PQconnectdb(); return 0; }
~~~~~~~~~~~ ^
/usr/include/libpq-fe.h:234:1: note: 'PQconnectdb' declared here
extern PGconn *PQconnectdb(const char *conninfo);
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int t(void) { PQconnectdb(); return 0; }
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
/* end */
--------------------
have_library: checking for PQconnectdb() in -llibpq... -------------------- no
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -Wl,-rpath,/usr/lib -lruby.2.0.0 -llibpq -lpthread -ldl -lobjc "
ld: library not found for -llibpq
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
/* end */
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -Wl,-rpath,/usr/lib -lruby.2.0.0 -llibpq -lpthread -ldl -lobjc "
conftest.c:7:27: error: too few arguments to function call, single argument 'conninfo' was not specified
int t(void) { PQconnectdb(); return 0; }
~~~~~~~~~~~ ^
/usr/include/libpq-fe.h:234:1: note: 'PQconnectdb' declared here
extern PGconn *PQconnectdb(const char *conninfo);
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int t(void) { PQconnectdb(); return 0; }
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
/* end */
--------------------
have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -Wl,-rpath,/usr/lib -lruby.2.0.0 -lms/libpq -lpthread -ldl -lobjc "
ld: library not found for -lms/libpq
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
/* end */
"/usr/bin/clang -o conftest -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin11.4.2 -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/local/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/lib -L/usr/lib -L/opt/local/lib -L. -fstack-protector -L/usr/local/lib -L/opt/local/lib -Wl,-rpath,/usr/lib -lruby.2.0.0 -lms/libpq -lpthread -ldl -lobjc "
conftest.c:7:27: error: too few arguments to function call, single argument 'conninfo' was not specified
int t(void) { PQconnectdb(); return 0; }
~~~~~~~~~~~ ^
/usr/include/libpq-fe.h:234:1: note: 'PQconnectdb' declared here
extern PGconn *PQconnectdb(const char *conninfo);
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int t(void) { PQconnectdb(); return 0; }
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
/* end */
--------------------
Xcode版本:4.6
Rails版本:4.0.0
Ruby版本:Ruby-2.0.0-p247:
$gcc—版本
i686-apple-darwin11-llvm-gcc-4.2(gcc)4.2.1(基于apple Inc.build 5658)(llvm build 2336.11.00)
版权所有(C)2007免费软件基金会。
这是自由软件;有关复制条件,请参见源。没有
担保甚至不是为了适销性或适合某一特定目的。
$gem安装pg
构建本机扩展。这可能需要一段时间。。。
错误:安装pg时出错:
错误:无法生成gem本机扩展。
/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
正在检查pg_配置。。。对
使用/usr/bin/pg_config中的配置值
正在检查libpq fe.h。。。对
正在检查libpq/libpq fs.h。。。对
正在检查pg_config_manual.h。。。对
正在-lpq中检查PQconnectdb()。。。不
正在-llibpq中检查PQconnectdb()。。。不
正在-lms/libpq中检查PQconnectdb()。。。不
找不到PostgreSQL客户端库(libpq)
***extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或标题。有关详细信息,请查看mkmf.log文件。你可以
需要配置选项。
提供的配置选项:
--使用opt dir
--选择包含
--不带opt include=${opt dir}/include
--使用opt lib
--不带opt lib=${opt dir}/lib
--用make prog
--没有make prog
--srcdir=。
--库尔迪尔
--ruby=/Users/arturo/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
--与pg
--无pg
--使用pg配置
--没有pg配置
--带-pg_配置
--不带-pg_配置
--与pg dir
--没有pg dir
--与pg包括
--不带pg include=${pg dir}/include
--用pg-lib
--不带pg lib=${pg dir}/
--使用pqlib
--没有pqlib
--使用libpqlib
--没有libpqlib
--使用ms/libpqlib
--没有ms/libpqlib
Gem文件仍将安装在/Users/arturo/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0中,以供检查。
结果记录到/Users/arturo/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0/ext/gem_make.out
$cat/Users/arturo/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0/ext/mkmf.log
查找\u可执行文件:正在检查pg\u配置…------------对
--------------------
/usr/usr/usr/b/b/b/b/b/b/b/bin/b/bin/b/b/Rub红宝石/红宝石/红宝石/红宝石/2.0.0.0-p247-47/包括/包括/usr/b/b/b/b/bin/b/b/b/b/b/rubibis/红宝石/红宝石/红宝石/红宝石/红宝石/用户/用户/2.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0-p247-p247-p247/包括/包括/包括/包括/包括/包括/包括/红宝石/红宝石-2.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0pt/local/include-O3-fno fast math-ggdb3-Wall-Wextra-Wno unused参数-Wno括号-Wno long-Wno缺少字段初始值设定项-Wunused变量-Wpointer arith-Wwrite strings-Wdeclaration after语句-Wshorten-64-to-32-Wimplicit函数声明-fno common-pipe conftest.c-L-L/Users/arturo/.rvm/rubies/ruby-2.0。0-p247/lib-L/usr/lib-L/opt/local/lib-L.-fstack protector-L/usr/local/lib-L/opt/local/lib-lruby.2.0.0-lpthread-ldl-lobjc“
检查的程序是:
/*开始*/
1:#包括“ruby.h”
2:
3:int main(int argc,字符**argv)
4: {
5:返回0;
6: }
/*结束*/
/usr/usr/usr/b/b/b/b/b/b/b/bin/b/bin/b/b/Rub红宝石/红宝石/红宝石/红宝石/2.0.0.0-p247-47/包括/包括/usr/b/b/b/b/bin/b/b/b/b/b/rubibis/红宝石/红宝石/红宝石/红宝石/红宝石/用户/用户/2.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0-p247-p247-p247/包括/包括/包括/包括/包括/包括/包括/红宝石/红宝石-2.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0pt/local/include-O3-fno fast math-ggdb3-Wall-Wextra-Wno unused参数-Wno括号-Wno long-Wno缺少字段初始值设定项-Wunused变量-Wpointer arith-Wwrite strings-Wdeclaration after语句-Wshorten-64-to-32-Wimplicit函数声明-fno common-pipe conftest.c-L-L/Users/arturo/.rvm/rubies/ruby-2.0。0-p247/lib-L/usr/lib-L/opt/local/lib-L.-fstack protector-L/usr/local/lib-L/opt/local/lib-lruby.2.0.0-Wl,-rpath,/usr/lib-lpthread-ldl-lobjc“
检查的程序是:
/*开始*/
1:#包括“ruby.h”
2:
3:int main(){return 0;}
/*结束*/
find_头:检查libpq fe.h..-------对
/usr/usr/b/b/b/b/b/b/b/b/b/b/b/bin/b/b/b/b/b/3.0.0-p247/包括/包括/包括/红宝石2.2.0.0.0.0.0.0-p247/包括/包括/包括/包括/红宝石2.2.0.0.0.0.0.0-p247/包括/包括/红宝石2.0.0.0.0.0.0.0.0.0.0.0.0/4/8/8/8/8/8/8/8/8/8/8/8/8/8/8/8/8/8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0/p247/7/7/7/7/7/7 7/包括/包括/包括/include-O3-fno fast math-ggdb3-Wall-Wextra-Wno unused参数-Wno括号-Wno long-Wno缺少字段初始值设定项-Wunused变量-Wpointer arith-Wwrite strings-Wdeclaration after语句-Wshorten-64-to-32-Wimplicit函数声明-fno common-pipe conftest.c-o conftest.i“
检查的程序是:
/*开始*/
1:#包括“ruby.h”
2:
3:#包括
/*结束*/
--------------------
find_头:检查libpq/libpq fs.h..-------对
/usr/usr/b/b/b/b/b/b/b/b/b/b/b/bin/b/b/b/b/b/3.0.0-p247/包括/包括/包括/红宝石2.2.0.0.0.0.0.0-p247/包括/包括/包括/包括/红宝石2.2.0.0.0.0.0.0-p247/包括/包括/红宝石2.0.0.0.0.0.0.0.0.0.0.0.0/4/8/8/8/8/8/8/8/8/8/8/8/8/8/8/8/8/8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0/p247/7/7/7/7/7/7 7/包括/包括/包括/include-O3-fno fast math-ggdb3-Wall-Wextra-Wno unused参数-Wno括号-Wno long-Wno缺少字段初始值设定项-Wunused变量-Wpointer arith-Wwrite strings-Wdeclaration after语句-Wshorten-64-to-32-Wimplicit函数声明-fno common