2012-12-31 179 views
2

Possible Duplicate:
Unable to install pg gem on ubuntu - Can’t find the 'libpq-fe.h header爲什麼安裝gem'pg'時會出錯?

我試圖寶石PG添加到我的本地環境。
但它返回該錯誤

Errno::EACCES: Permission denied - /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/.gemtest 
An error occurred while installing pg (0.14.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.14.1'` succeeds before bundling. 

我應該怎麼辦?

的錯誤落山後,現在它返回該錯誤

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

     /Users/me/.rvm/rubies/ruby-1.9.3-p362/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 
    --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/me/.rvm/rubies/ruby-1.9.3-p362/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.9.3-p362/gems/pg-0.14.1 for inspection. 
Results logged to /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/ext/gem_make.out 
An error occurred while installing pg (0.14.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.14.1'` succeeds before bundling. 
+0

你是怎麼安裝PostgreSQL? –

回答

3

我相信你正在使用sudo瞎搞
前嘗試

chown -R `whoami`:staff ~/.rvm/gems/ruby-1.9.3-p362/gems 
+0

感謝,但它返回錯誤的MacBook :(-PRO:我$喬敦 - R的'whoami':'whoami'〜/ .rvm /寶石/紅寶石1.9.3-P362 /寶石 CHOWN:我:無效的參數 – MKK

+0

剛。意識到你正在使用OSX編輯 –

+1

現在一切都看起來不錯我做了之後**創業板安裝PG - --with-PG-配置= /選擇/ local/lib目錄/ postgresql910 /斌/ pg_config **感謝 – MKK

1

它看起來像有人試圖在過去的sudo來安裝它。我會檢查那個目錄的權限,如果他們看起來不對,請將這些文件剪下來。

+0

是的,我已經做了很多事情,但我不記得我做了所有東西:(我應該CHOWN做些什麼命令行?請幫 – MKK

+0

須藤喬敦 - R的youruser:yourgroup〜/ .rvm /寶石/紅寶石1.9。 3-P362 /寶石/ PG-0.14.1/ – sgrif

+0

感謝它返回CHOWN:yourgroup:無效的參數 – MKK

相關問題