2012-02-01 18 views
0

私はこれを修正しようと多くの時間を費やしました。pg gem install error - lion osx、bundler、rvm

私は自分のコンピュータを再フォーマットしました。すっきりとしたヒョウヒョウは、即座にライオンにアップグレードするよりも優れていました。

のXcode 4.2.1 RVMは私のセットアップとして私の環境を

をインストール

をインストールし、私は最終的にインストールバンドルするようになった、それがPGの宝石を作成しようとしませんでした。

私はmacportsを使用してpostgresqlをインストールしました(そのプレインストールされたライオンを認識していませんでした)。ここでは、次の手順をします。http://benscheirman.com/2010/06/installing-postgresql-for-rails-on-mac-os-xとPGの宝石をインストールしようとしているより多くのエラーに遭遇した:

Installing pg (0.12.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/me/.rvm/rubies/ruby-1.8.7-p357/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/local/bin/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 
    --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=/Users/sling31/.rvm/rubies/ruby-1.8.7-p357/bin/ruby 
    --with-pg 
    --without-pg 
    --with-pg-dir 
    --without-pg-dir 
    --with-pg-include 
    --without-pg-include=${pg-dir}/include 
    --with-pg-lib 
    --without-pg-lib=${pg-dir}/lib 
    --with-pg-config 
    --without-pg-config 
    --with-pg_config 
    --without-pg_config 


Gem files will remain installed in /Users/me/.rvm/gems/ruby-1.8.7-p357/gems/pg-0.12.0 for inspection. 
Results logged to /Users/me/.rvm/gems/ruby-1.8.7-p357/gems/pg-0.12.0/ext/gem_make.out 
An error occured while installing pg (0.12.0), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.12.0'` succeeds before bundling. 

私はstackoverflowをノンストップで検索し、ほとんどすべてを試しました。

私はMacPortsのバージョンを削除し、その後、自作でインストールしようとすることを決めた:

"BREWは、PostgreSQLをインストール"

はpg_configが私を与える:

BINDIR = /usr/local/Cellar/postgresql/9.1.2/bin 
DOCDIR = /usr/local/Cellar/postgresql/9.1.2/share/doc/postgresql 
HTMLDIR = /usr/local/Cellar/postgresql/9.1.2/share/doc/postgresql 
INCLUDEDIR = /usr/local/Cellar/postgresql/9.1.2/include 
PKGINCLUDEDIR = /usr/local/Cellar/postgresql/9.1.2/include 
INCLUDEDIR-SERVER = /usr/local/Cellar/postgresql/9.1.2/include/server 
LIBDIR = /usr/local/Cellar/postgresql/9.1.2/lib 
PKGLIBDIR = /usr/local/Cellar/postgresql/9.1.2/lib 
LOCALEDIR = /usr/local/Cellar/postgresql/9.1.2/share/locale 
MANDIR = /usr/local/Cellar/postgresql/9.1.2/share/man 
SHAREDIR = /usr/local/Cellar/postgresql/9.1.2/share/postgresql 
SYSCONFDIR = /usr/local/Cellar/postgresql/9.1.2/etc 
PGXS = /usr/local/Cellar/postgresql/9.1.2/lib/pgxs/src/makefiles/pgxs.mk 
CONFIGURE = '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/9.1.2' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-krb5' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-python' '--with-perl' '--with-ossp-uuid' '--datadir=/usr/local/Cellar/postgresql/9.1.2/share/postgresql' '--docdir=/usr/local/Cellar/postgresql/9.1.2/share/doc/postgresql' 'ARCHFLAGS='''-arch x86_64'''' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-O3 -w -pipe -march=core2 -msse4.1 -I/opt/local/include/ossp' 'LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib -L/opt/local/lib' 'LIBS=-luuid' 'CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2' 
CC = /usr/bin/llvm-gcc 
CPPFLAGS = -I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2 -I/opt/local/include/libxml2 
CFLAGS = -O3 -w -pipe -march=core2 -msse4.1 -I/opt/local/include/ossp -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv 
CFLAGS_SL = 
LDFLAGS = -L/usr/local/Cellar/readline/6.2.2/lib -L/opt/local/lib -L/opt/local/lib -Wl,-dead_strip_dylibs 
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm -luuid 
VERSION = PostgreSQL 9.1.2 

私は輸出rvm_archflagsの全てを試してみました= " - arch x86_64"タイプのソリューションはありませんでしたが、何も違いはありませんでした。

どこから始めたらよいですか?

+0

自宅のエラーは何ですか?あなたが 'brew info postgres'をしたときに何を言いますか? – Woahdae

+0

それはbrewの下で正しくインストールされますが、まだGem拡張をビルドしないことを意味しますか? – Woahdae

答えて

1

私はBrewに慣れていませんが、あなたが呼び出しているpg_configはpgの設定に使用されていないようです。

したがって、パスに/usr/local/Cellar/postgresql/9.1.2/bin(そこにpg_configがあることを期待してください)を入れて再試行してください。

実際には、出力には「/ usr/local/bin/pg_configの設定値を使用しています」 BREWのパスのpg_configにする必要があります。私は/usr/local/Cellar/postgresql/9.1.2/binにあると思います。

関連する問題