2013-11-05 44 views
1

我想在我的Mac上更新Mavericks後運行捆綁軟件安裝/捆綁更新,但出現以下錯誤。有任何想法嗎?新Mavericks更新後Ruby Bundle安裝/更新

我使用RVM來管理一切。

Fetching gem metadata from https://rubygems.org/......... 
Fetching gem metadata from https://rubygems.org/.. 
Using rake (10.1.0) 
Using i18n (0.6.5) 
Using multi_json (1.8.2) 
Using activesupport (3.2.1) 
Using builder (3.0.4) 
Using activemodel (3.2.1) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.1.3) 
Using actionpack (3.2.1) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.4.4) 
Using actionmailer (3.2.1) 
Using arel (3.0.2) 
Using tzinfo (0.3.38) 
Using activerecord (3.2.1) 
Using activeresource (3.2.1) 
Using bcrypt-ruby (3.0.1) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.2) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.3) 
Using json (1.8.1) 
Using rdoc (3.12.2) 
Using thor (0.14.6) 
Using railties (3.2.1) 
Using coffee-rails (3.2.2) 
Using jquery-rails (3.0.4) 
Installing pg (0.17.0) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

/Users/robin/.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... 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/robin/.rvm/rubies/ruby-2.0.0-p247/bin/ruby 
    --with-pg 
    --without-pg 
    --with-pg-config 
    --without-pg-config 
    --with-pg_config 
    --without-pg_config 
    --with-pg-dir 
    --without-pg-dir 
    --with-pg-include=${pg-dir}/include 
    --with-pg-lib 
    --without-pg-lib=${pg-dir}/ 


Gem files will remain installed in /Users/robin/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.0 for inspection. 
Results logged to /Users/robin/.rvm/gems/ruby-2.0.0-p247/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. 

所以是的,我無法弄清楚問題所在。我想下載PostgreSQL的寶石?我已經從XCode獲得了命令行工具。

+1

我個人更喜歡使用PostgresApp for mac。 http://postgresapp.com/ –

+2

你用自制軟件安裝postgresql嗎?嘗試'brew重新安裝postgresql'然後'捆綁安裝'... – CDub

回答

0

如果使用的是自制,這樣做的伎倆:

  • 的Xcode選--install
  • 釀造更新
  • 沖泡重新安裝/安裝PostgreSQL

然後你會能夠從Gemfile安裝pg

0

對於那些閱讀本文的人以及使用Xcode 5的Mavericks,那麼喲你必須得到Xcode 5的命令行工具才能獲得寶石。運行xcode-select --install可能無法檢索全新Xcode的命令行工具。轉到Apple Developer site,然後轉到下載。您可能必須註冊爲Apple開發人員。爲Xcode下載:命令行工具(OSX Mavericks) - 10月下旬

此外,我建議使用Postgres.app。也下載這個。卸載並刪除任何以前安裝的Postgres,如果你有它們潛伏在你的系統中。安裝後,請確保您可以通過調用psql或通過調用來從命令行運行psql。如果你已經安裝了Postgres,你應該擁有它。如果你不能把它,你可能需要將其添加到您的PATH變量,就像這樣:

PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

(在我的系統,我下載了最新的Postgres.app,所以我的路徑變量是:

PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"

假如把它放在你的.bash_profile所以你總是可以訪問它的終端。關於在Mac,Linux或Windows上設置的Postgres一個很大參考,請參閱this documentation from Heroku

最後,你應該能夠得到創業板:

gem install pg

對於那些你從SQLite的切換到Postgres的,我還建議this documentation from Heroku as well