使用rvm,postgres 9.0,ruby 1.9.2-p136在64位Snow Leopard上安装
发布时间:2020-12-17 03:34:54 所属栏目:百科 来源:网络整理
导读:我想为Heroku构建一个Rails 3应用程序. 他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres 9.0. 现在我需要一个postgres宝石,并且出于性能原因的共识 你想要pg宝石.然而,我对我得到的错误感到困惑 当我尝试通过rvm下的gem install安装pg.
我想为Heroku构建一个Rails 3应用程序.
他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres 9.0. 现在我需要一个postgres宝石,并且出于性能原因的共识 你想要pg宝石.然而,我对我得到的错误感到困惑 当我尝试通过rvm下的gem install安装pg. 我通过指定所有postgres目录的位置非常明确 $env ARCHFLAGS='-arch x86_64' gem install pg -- --with-pg-config=/opt/local/var/db/postgresql90/defaultdb/postgresql.conf --with-pg-include=/opt/local/include/postgresql90/ --with-pg-lib=/opt/local/lib/postgresql90/ Using config values from /opt/local/var/db/postgresql90/defaultdb/postgresql.conf *** 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/guy/.rvm/ruby-1.9.2-p136/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include=${pg-dir}/include --with-pg-lib=${pg-dir}/lib --with-pg-config extconf.rb:24:in ``': Exec format error - /opt/local/var/db/postgresql90/defaultdb/postgresql.conf --includedir (Errno::ENOEXEC) from extconf.rb:24:in `<main>' 有人有任何想法吗? 解决方法
我认为你的问题就在这里:
--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/postgresql.conf –with-pg-config开关可能想知道pg_config脚本的位置而不是postgresql.conf.你应该在/ opt / local / bin(可能)下的某个地方有一个pg_config脚本,它应该产生一大堆这样的东西: BINDIR = /Users/mu/Developer/Cellar/postgresql/9.0.1/bin DOCDIR = /Users/mu/Developer/Cellar/postgresql/9.0.1/share/doc HTMLDIR = /Users/mu/Developer/Cellar/postgresql/9.0.1/share/doc INCLUDEDIR = /Users/mu/Developer/Cellar/postgresql/9.0.1/include PKGINCLUDEDIR = /Users/mu/Developer/Cellar/postgresql/9.0.1/include INCLUDEDIR-SERVER = /Users/mu/Developer/Cellar/postgresql/9.0.1/include/server LIBDIR = /Users/mu/Developer/Cellar/postgresql/9.0.1/lib PKGLIBDIR = /Users/mu/Developer/Cellar/postgresql/9.0.1/lib ... 当你运行它. pg_config脚本告诉您(或任何要求的人)各种头文件和库的位置以及需要哪些编译器标志. “Exec格式错误”错误消息是赠送.听起来你正在尝试执行操作系统不知道如何执行的东西,我不希望OSX知道如何执行某些任意配置文件. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |