2011-05-17 43 views
2

我試圖運行 $ bundle更新,但它在通過幾個gems後以下內容:

Installing pg (0.11.0) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /opt/local/lib/postgresql83/bin/pg_config 
checking for libpq-fe.h... yes 
checking for libpq/libpq-fs.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/1.8/usr/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 
    --with-pqlib 
    --without-pqlib 
    --with-libpqlib 
    --without-libpqlib 
    --with-ms/libpqlib 
    --without-ms/libpqlib 


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/pg-0.11.0 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/pg-0.11.0/ext/gem_make.out 
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `each' 
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `build_extensions' 
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:198:in `install' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:252:in `update' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start' 
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/bin/bundle:13 
    from /usr/bin/bundle:19:in `load' 
    from /usr/bin/bundle:19 

你見過這個還是有什麼突破這裏有什麼想法?感謝

+0

我需要使用Postgres和rails 3.在gemfile中註釋gem'pg'#Postgres使得bundle更新正常工作。我應該不使用pg gem嗎? – AnApprentice 2011-05-17 05:18:40

回答

0

運行曾任職:

sudo bundle install 
+1

我知道這已經過了幾年了,但這些日子(2014年)bundler在執行此操作時會給出警告: '不要以root身份運行Bundler。 Bundler可以詢問sudo是否需要,並且以root用戶身份安裝捆綁軟件 將會爲該機器上的所有非root用戶中斷該應用程序。 – 2014-07-21 16:15:16

3

當你試圖編譯一個Postgres寶石紅寶石,您必須安裝有Posgtresql庫的開發版本,在Ubuntu(Debian的等),它被命名爲libpq-dev和客戶端庫,名爲libpqx(x是此庫的版本)。

相關問題