为了账号安全,请及时绑定邮箱和手机立即绑定

无法使用Mavericks在我的Mac上安装PG gem

无法使用Mavericks在我的Mac上安装PG gem

慕娘9325324 2019-12-10 10:05:11
我正在尝试安装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


查看完整回答
反对 回复 2019-12-10
  • 3 回答
  • 0 关注
  • 558 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信