我正在嘗試安裝pg gem,以便再次與我的rails項目一起使用。但是我得到這個錯誤:構建本機擴展。這可能需要一段時間...錯誤:安裝pg時出錯:錯誤:無法生成gem本機擴展。/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If構建失敗,請使用--with-pg-config = / path / to / pg_config再試一次以檢查libpq-fe.h ...否找不到'libpq-fe.h標頭 * extconf.rb失敗*由于某些原因(可能缺少必要的庫和/或標頭)而無法創建Makefile。檢查mkmf.log文件以獲取更多詳細信息。您可能需要配置選項。提供的配置選項:--with-opt-dir --without-opt-dir --with-opt-include --without-opt-include = $ {opt-dir} / include --with-opt-lib-沒有-opt-lib = $ {opt-dir} / lib --with-make-prog --without-make-prog --srcdir =。--curdir --ruby = /用戶/jeanosorio/.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 --without-pg-include = $ {pg-dir} / include- -with-pg-lib --without-pg-lib = $ {pg-dir} /寶石文件將保留安裝在/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0中以進行檢查。結果記錄到/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0/ext/gem_make.out我嘗試了在stackoverflow上找到的所有內容,但仍然收到此錯誤。如果我嘗試使用brew安裝postgresql,則會收到以下警告:警告:postgresql-9.2.4已經安裝,只是沒有鏈接如果我嘗試鏈接brew鏈接postgresql鏈接/usr/local/Cellar/postgresql/9.2.4 ...警告:無法鏈接postgresql。取消連結...錯誤:無法符號鏈接文件:/usr/local/Cellar/postgresql/9.2.4/share/man/man7/WITH.7 / usr / local / share / man / man7是不可寫的。您應該更改其權限。請幫忙注意:我已經安裝了特立獨行的命令行工具。如果我使用自制軟件卸載并嘗試重新安裝,則會收到此錯誤:==>下載http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.bz2################################################ ################ 100.0%==>修補補丁文件src / pl / plpython / Makefile修補文件contrib / uuid-ossp / uuid-ossp.c ==> ./configure --prefix = / usr / local / Cellar / postgresql / 9.2.4- datadir = / usr / local / Cellar / postgresql / 9.2.4 / share / postgresql --docdir = / usr / local / Cellar / p ==> make install-world ==>警告建造說明如果PostgreSQL 9的構建失敗,并且您已安裝版本8.x,則可能需要先刪除先前的版本。參見:https ://github.com/mxcl/homebrew/issues/issue/2510
3 回答

滄海一幻覺
TA貢獻1824條經驗 獲得超5個贊
使用brew獲得 postgresql
brew install postgresql
檢查已安裝的brew中是否包含pg_config。我發現我的
/ usr / local /地窖/postgresql/9.3.3/bin/pg_config
通過檢查:
$ ls /usr/local/Cellar/postgresql/9.3.3/bin/pg_config
> /usr/local/Cellar/postgresql/9.3.3/bin/pg_config
完成后,pg使用
env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/usr/local/Cellar/postgresql/9.3.3/bin/pg_config
- 3 回答
- 0 關注
- 630 瀏覽
添加回答
舉報
0/150
提交
取消