2015-02-04 4 views
0

Рубин Версия 2.0.0p481PG камень на OSX Yosemite не обновляя

Рельсы Версия 4.1.8

PG версии 0.18.1

Я пытаюсь следовать Heroku-х Getting Started with Heroku Tutorial. Все работает нормально, пока мне не нужно запускать приложение локально и перенести базу данных. Команда bundle exec rake db:create db:migrate дает мне ошибку:

Could not find gem 'rails (= 4.1.8) ruby' in the gems available on this machine. 
Run `bundle install` to install missing gems. 

Когда я бегу bundle install:

Fetching gem metadata from https://rubygems.org/............ 
Resolving dependencies... 
Using rake 10.4.2 
Using i18n 0.7.0 
Using json 1.8.2 
Using minitest 5.5.1 
Using thread_safe 0.3.4 
Using tzinfo 1.2.2 
Using activesupport 4.1.8 
Using builder 3.2.2 
Using erubis 2.7.0 
Using actionview 4.1.8 
Using rack 1.5.2 
Using rack-test 0.6.3 
Using actionpack 4.1.8 
Using mime-types 2.4.3 
Using mail 2.6.3 
Using actionmailer 4.1.8 
Using activemodel 4.1.8 
Using arel 5.0.1.20140414130214 
Using activerecord 4.1.8 
Using bundler 1.6.2 
Using coffee-script-source 1.9.0 
Using execjs 2.3.0 
Using coffee-script 2.3.0 
Using thor 0.19.1 
Using railties 4.1.8 
Using coffee-rails 4.0.1 
Using hike 1.2.3 
Using multi_json 1.10.1 
Using jbuilder 2.2.6 
Using jquery-rails 3.1.2 

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/local/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 
--without-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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 
--with-pg 
--without-pg 
--enable-windows-cross 
--disable-windows-cross 
--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/avl1/Desktop/btc/vendor/bundle/ruby/2.0.0/gems/pg-0.18.1 for inspection. 
Results logged to /Users/avl1/Desktop/btc/vendor/bundle/ruby/2.0.0/gems/pg-0.18.1/ext/gem_make.out 
An error occurred while installing pg (0.18.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.18.1'` succeeds before bundling. 

Когда я бегу gem install pg -v '0.18.1':

ERROR: While executing gem ... (Gem::FilePermissionError) 
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. 

Когда я бегу sudo gem install pg -v '0.18.1'

Building native extensions. This could take a while... 

ОШИБКА: Ошибка при установке pg: ОШИБКА: Не удалось создать собственное расширение gem.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/local/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 
--without-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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 
--with-pg 
--without-pg 
--enable-windows-cross 
--disable-windows-cross 
--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 /Library/Ruby/Gems/2.0.0/gems/pg-0.18.1 for inspection. 
Results logged to /Library/Ruby/Gems/2.0.0/gems/pg-0.18.1/ext/gem_make.out 

Я пробовал все, что я могу найти, используя gg gg на google. Я понятия не имею, что случилось. Любая помощь высоко ценится! Я запускаю приложение Postgresql, и раньше я разрабатывал приложения, используя драгоценный камень PG на этой машине, только после обновления до Yosemite.

@maxshelley - Я сделал это и сказал, что у меня нет разрешений. Использовал sudo, и он дал мне эту ошибку: Создание собственных расширений с: '--with-pg-config =/Applications/Postgres.app/Содержание/Версии/9.3/bin/pg_config' Это может занять некоторое время. .. ОШИБКА: Ошибка при установке pg: ОШИБКА: Не удалось создать собственное расширение gem.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config 
Using config values from /Applications/Postgres.app/Contents/Versions/9.3/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 
--without-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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 
--with-pg 
--without-pg 
--enable-windows-cross 
--disable-windows-cross 
--with-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 /Library/Ruby/Gems/2.0.0/gems/pg-0.18.1 for inspection. 
Results logged to /Library/Ruby/Gems/2.0.0/gems/pg-0.18.1/ext/gem_make.out 

@maxshelley - Вот мой файл mkmf.log.

find_executable: checking for pg_config... -------------------- yes 

-------------------- 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -arch x86_64 -arch i386 -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 */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -arch x86_64 -arch i386 -lruby.2.0.0 -Wl,-rpath,/usr/local/Cellar/postgresql/9.4.0/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 

"xcrun clang -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS -arch x86_64 -arch i386 -c conftest.c" 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
/* end */ 

-------------------- 

find_header: checking for libpq/libpq-fs.h... -------------------- yes 

"xcrun clang -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS -arch x86_64 -arch i386 -c conftest.c" 
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 

"xcrun clang -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS -arch x86_64 -arch i386 -c conftest.c" 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <pg_config_manual.h> 
/* end */ 

-------------------- 

have_library: checking for PQconnectdb() in -lpq... -------------------- no 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/postgresql/9.4.0/lib -arch x86_64 -arch i386 -lruby.2.0.0 -lpq -lpthread -ldl -lobjc " 
ld: warning: ignoring file /usr/local/Cellar/postgresql/9.4.0/lib/libpq.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/postgresql/9.4.0/lib/libpq.dylib 
Undefined symbols for architecture i386: 
    "_PQconnectdb", referenced from: 
     _t in conftest-ddf793.o 
ld: symbol(s) not found for architecture i386 
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 */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/postgresql/9.4.0/lib -arch x86_64 -arch i386 -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/local/Cellar/postgresql/9.4.0/include/libpq-fe.h:250: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 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/postgresql/9.4.0/lib -arch x86_64 -arch i386 -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 */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/postgresql/9.4.0/lib -arch x86_64 -arch i386 -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/local/Cellar/postgresql/9.4.0/include/libpq-fe.h:250: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 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/postgresql/9.4.0/lib -arch x86_64 -arch i386 -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 */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.4.0/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/postgresql/9.4.0/lib -arch x86_64 -arch i386 -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/local/Cellar/postgresql/9.4.0/include/libpq-fe.h:250: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 */ 

ответ

0

Похоже, что дергает за pg_config значения из /usr/local/bin/pg_config однако я имел лучший опыт с приложением Postgres, когда говорю это, чтобы использовать собственный pg_config значение.

Вы можете сделать это с with-pg-config флагом:

gem install pg -v '0.18.1' -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config 

Вы должны найти правильный путь для вашей машины. Перейдите в папку «Приложения», щелкните правой кнопкой мыши на Postgres.app и выберите «Показать содержимое пакета», и вы можете найти файл pg_config.

Update:

Некоторые очень любезны лицо было бдительно уточненный список pg_config путей на Cannot install pg gem in Mavericks with Postgres.app

+0

Я попробовал, и он дал больше ошибок. Я приложил результаты к исходному вопросу –

+0

Что скажет файл mkmf.log? Этот ответ - http: // stackoverflow.com/questions/6209797/cant-find-the-postgresql-client-library-libpq - указывает, что добавление флага 'env ARCHFLAGS =" - arch x86_64 "" может решить проблему? – maxshelley

+0

Я добавил файл mkmf.log к сообщению. Кроме того, когда я устанавливаю флажок 'env ARCHFLAGS =" - arch x86_64 "', он успешно устанавливается, но как только я возвращаюсь к исходной команде ('bundle exec rake db: create db: migrate'), он сообщает мне, что я не установлены рельсы 4.1.8 и говорят, чтобы запускать 'bundle install', что возвращает меня к исходной проблеме, когда pg не может быть установлен. Я попытался переустановить жерл рельсов, прежде чем обращаться с жемчугом pg, и он успешно установлен, а затем успешно установлен pg, но когда я снова запустил эту первую команду, он говорит, что рельсы не установлены. –

Смежные вопросы