2016-09-02 9 views
5

üzerine yakut için pg yükleyin ve Bundler devam edemez. Paketlemeden önce gem install pg -v '0.18.4''un başarılı olduğundan emin olun. chriss-MacBook-Pro: shine chriswilson $ bundle exec install kullanımı: install [-bCcpSsv] [-B sonek] [-f bayrakları] [-g grubu] [-m modu] [-o sahibi] dosya1 dosya2 [-bCcpSsv] [-B sonekini yükle] [-f bayrakları] [-g grubu] [-m modu] [-o sahip] file1 ... fileN dizini install -d [-v] [-g group] [-m modu] [-o sahibi] dizini ... chriss-MacBook-Pro: shine chriswilson $ gem install pg -v '0.18.4' Yerel uzantıları oluşturma. Bu biraz zaman alabilir ... HATA: pg yükleme hatası: HATA: Gem yerel uzantısı oluşturulamadı.mücevher burada sf (0.18.4) yüklerken</p> <p>n hata altına verilerim oluştu olduğunu Postgresql OSX yüklenmez raylar

current directory: /Users/chriswilson/.rvm/gems/ruby-2.3.0/gems/pg-0.18.4/ext 
/Users/chriswilson/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160902-1617-e1qwb1.rb extconf.rb 
checking for pg_config... no 
No pg_config... trying anyway. If building fails, please try again with 
--with-pg-config=/path/to/pg_config 
checking for libpq-fe.h... no 
Can't find the 'libpq-fe.h header 
*** 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/chriswilson/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME) 
    --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}/lib 

To see why this extension failed to compile, please check the mkmf.log which can be found here: 

    /Users/chriswilson/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/pg-0.18.4/mkmf.log 

extconf failed, exit code 1 

Gem files will remain installed in /Users/chriswilson/.rvm/gems/ruby-2.3.0/gems/pg-0.18.4 for inspection. 
Results logged to /Users/chriswilson/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/pg-0.18.4/gem_make.out 
chriss-MacBook-Pro:shine chriswilson$ gem install pg -v '0.18.4' 
Building native extensions. This could take a while... 
ERROR: Error installing pg: 
    ERROR: Failed to build gem native extension. 

    current directory: /Users/chriswilson/.rvm/gems/ruby-2.3.0/gems/pg-0.18.4/ext 
/Users/chriswilson/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160902-1643-jfhxyo.rb extconf.rb 
checking for pg_config... no 
No pg_config... trying anyway. If building fails, please try again with 
--with-pg-config=/path/to/pg_config 
checking for libpq-fe.h... no 
Can't find the 'libpq-fe.h header 
*** 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/chriswilson/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME) 
    --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}/lib 

To see why this extension failed to compile, please check the mkmf.log which can be found here: 

    /Users/chriswilson/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/pg-0.18.4/mkmf.log 

extconf failed, exit code 1 

Gem files will remain installed in /Users/chriswilson/.rvm/gems/ruby-2.3.0/gems/pg-0.18.4 for inspection. 
Results logged to /Users/chriswilson/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/pg-0.18.4/gem_make.out 



find_executable: checking for pg_config... -------------------- no 

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

find_header: checking for libpq-fe.h... -------------------- no 

"gcc -o conftest -I/Users/chriswilson/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/x86_64-darwin15 -I/Users/chriswilson/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/backward -I/Users/chriswilson/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -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 -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/chriswilson/.rvm/rubies/ruby-2.3.0/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib  -lruby.2.3.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 */ 

"gcc -E -I/Users/chriswilson/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/x86_64-darwin15 -I/Users/chriswilson/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/backward -I/Users/chriswilson/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -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 -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -o conftest.i" 
conftest.c:3:10: fatal error: 'libpq-fe.h' file not found 
#include <libpq-fe.h> 
     ^
1 error generated. 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
/* end */ 

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

cevap

10

Bu, temel olarak kurulumunuzda bir kitaplık veya program kaçırdığınız anlamına gelir.

brew install libpqxx 
gem install pg 

:

ortak eksik kütüphane yükleyin: Ben birkaç kez şimdi çok burada birkaç farklı şeyler denemek için (umarım bunlardan biri sizin için çalışacaktır) olan bu sorunu yaşadım yeniden yükleyin postgres (ideal değil biliyorum):

brew uninstall postgresql 
brew install postgresql 
gem install pg 

Açıkça pg_config yolunu tanımlayın:

1) pg_config yerini al

which pg_config 

2) mücevher içine yol MacPorts millet için

gem install pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config 
+0

yüklemek pass: 'mücevher yüklemek pg - --with-pg-config =/opt/local/lib/postgresql [sürüm numarası]/bin/pg_config' – PartialOrder

İlgili konular