복붙노트

[RUBY-ON-RAILS] ERROR : 매버릭스에 빌드 보석 네이티브 확장에 실패

RUBY-ON-RAILS

ERROR : 매버릭스에 빌드 보석 네이티브 확장에 실패

나는 OSX 10.9에 내 레일 프로젝트에 번들을 실행하려고하고 있습니다. 이 오류와 함께 페이지 보석에가는 때 실패

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

    /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/bin/ruby 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... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.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 PQescapeLiteral()... yes
checking for PQescapeIdentifier()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... yes
checking for PQping()... yes
checking for PQsetSingleRowMode()... yes
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... no
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_fd_select()... yes
checking for rb_w32_wrap_io_handle()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... no
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for PG_DIAG_TABLE_NAME in libpq-fe.h... no
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 "DESTDIR="
compiling gvl_wrappers.c
clang: warning: argument unused during compilation: '-fno-fast-math'
compiling pg.c
clang: warning: argument unused during compilation: '-fno-fast-math'
pg.c:272:9: warning: implicit declaration of function 'PQlibVersion' is invalid in C99 [-Wimplicit-function-declaration]
        return INT2NUM(PQlibVersion());
               ^
In file included from pg.c:48:
In file included from ./pg.h:17:
In file included from /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby.h:33:
/Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/ruby.h:1167:21: note: instantiated from:
# define INT2NUM(v) INT2FIX((int)(v))
                    ^
pg.c:272:9: note: instantiated from:
        return INT2NUM(PQlibVersion());
               ^
pg.c:272:17: note: instantiated from:
        return INT2NUM(PQlibVersion());
                       ^
pg.c:375:48: error: use of undeclared identifier 'PQPING_OK'
        rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
                                                      ^
pg.c:375:56: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
                                                              ^
pg.c:377:52: error: use of undeclared identifier 'PQPING_REJECT'
        rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
                                                          ^
pg.c:377:60: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
                                                                  ^
pg.c:379:57: error: use of undeclared identifier 'PQPING_NO_RESPONSE'
        rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
                                                               ^
pg.c:379:65: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
                                                                       ^
pg.c:381:56: error: use of undeclared identifier 'PQPING_NO_ATTEMPT'
        rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
                                                              ^
pg.c:381:64: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
                                                                      ^
1 warning and 4 errors generated.
make: *** [pg.o] Error 1


Gem files will remain installed in /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247@skateboxes/gems/pg-0.17.0 for inspection.
Results logged to /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247@skateboxes/gems/pg-0.17.0/ext/gem_make.out

An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.

해결법

  1. ==============================

    1.또한 당신이 매버릭스에 다시 설치 명령 줄 도구에 엑스 코드를 업그레이드했다고합니다. 터미널 타입 :

    또한 당신이 매버릭스에 다시 설치 명령 줄 도구에 엑스 코드를 업그레이드했다고합니다. 터미널 타입 :

    xcode-select --install
    

    그런 다음 화면의 지시를 따릅니다.

  2. ==============================

    2.내가 한 때 나를 위해 일했다 :

    내가 한 때 나를 위해 일했다 :

    brew install postgresql
    
  3. ==============================

    3.이 매버릭스와 Postgresapp과 나를 위해 일한 :

    이 매버릭스와 Postgresapp과 나를 위해 일한 :

    gem install pg -v '0.17.0' -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config
    
  4. ==============================

    4.--with-PG-설정 인수를 사용해보십시오 :

    --with-PG-설정 인수를 사용해보십시오 :

    bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config
    

    pg_config의 경로를 표시하려면 :

    which pg_config
    

    우분투 사용자의 경우 :

    sudo apt-get install postgresql
    sudo apt-get install libpq-dev
    

    그때:

    bundle install
    
  5. ==============================

    5.나 매버릭스을 사용하기 위해, 3.2.13는, 루비 2.0.0-p247은, PostgreSQL의 9.1, 나는이 할 일이 필요 레일 :

    나 매버릭스을 사용하기 위해, 3.2.13는, 루비 2.0.0-p247은, PostgreSQL의 9.1, 나는이 할 일이 필요 레일 :

    gem install pg -v '0.15.1' -- --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config
    
  6. ==============================

    6.난 그냥 수행하여 실행있어 한

    난 그냥 수행하여 실행있어 한

    ARCHFLAGS="-arch x86_64" gem install pg
    

    양조를 사용하여 설치 포스트 그레스 후

  7. ==============================

    7.이것은 맥 OS X 10.9.3 및 Postgres.app 버전 9.3.4.2에 나를 위해 일한 :

    이것은 맥 OS X 10.9.3 및 Postgres.app 버전 9.3.4.2에 나를 위해 일한 :

    1) 설치 Postgres.app

    2) 번들 설정 build.pg --with-PG-설정 = / 응용 프로그램 / Postgres.app / 내용 / 버전 / 9.3 / 빈 / pg_config

    3) 보석 설치 페이지 -v '0.17.1'

    4) 설치 번들

  8. ==============================

    8.내가 설치하려고 할 때

    내가 설치하려고 할 때

    apt-get install libpq-dev
    

    , 충족되지 않은 의존성 문제를 설치하지 못했습니다 해결하기 위해

    apt-get remove libpq5
    

    다음 설치

    apt-get install libpq-dev
    

    마지막으로 보석 페이지의 문제를 해결했다.

  9. ==============================

    9.다음은 나를 위해 일한 :

    다음은 나를 위해 일한 :

    보석 설치 페이지 -v '0.18.1'- --with-페이지 설정 = / 라이브러리 / PostgreSQL을 / 9.3 / 빈 / pg_config

  10. ==============================

    10.당신은 내가 요세미티에 광산을 9.4 버전을 사용하여 현재 버전을 구성 페이지에 있습니다. 여기에 다음과 같은 명령은

    당신은 내가 요세미티에 광산을 9.4 버전을 사용하여 현재 버전을 구성 페이지에 있습니다. 여기에 다음과 같은 명령은

    bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config 
    

    당신은 당신의 자신의 버전을 사용한다

    bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/(YOUR POSTGRES VERSION)/bin/pg_config 
    

    다음 할

    bundle install
    
  11. ==============================

    11.오류가 설치 디버거 (1.6.5) 동안 발생한 및 Bundler를 계속할 수 없습니다. 보석 '디버거 -v 설치 있는지'확인 1.6.5'` 번들 전에 성공합니다.

    오류가 설치 디버거 (1.6.5) 동안 발생한 및 Bundler를 계속할 수 없습니다. 보석 '디버거 -v 설치 있는지'확인 1.6.5'` 번들 전에 성공합니다.

    나는 루비 V2.0.0로 롤백하여이 오류를 해결할 수 있었다. 나는이 디버거 버전이 지원되지 않습니다 루비 2.1.1을 실행했다. 여러분이이 문제에 실행하면 당신의 루비 버전을 확인해야합니다.

  12. from https://stackoverflow.com/questions/19569031/error-failed-to-build-gem-native-extension-on-mavericks by cc-by-sa and MIT license