blu*_*din 71 postgresql macos ruby-on-rails pg osx-mavericks
我正在尝试安装pg gem以便在我的本地机器上使用Postgres.app.我正在经营小牛队.
Postgres.app安装并运行正常,但我无法让宝石工作.我做了以下事情:
一切都没有成功.这是我收到的具体错误消息:
Building native extensions with: '--with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config'
This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/Brian/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/MacOS/bin/pg_config
sh: /Applications/Postgres.app/Contents/MacOS/bin/pg_config: No such file or directory
sh: /Applications/Postgres.app/Contents/MacOS/bin/pg_config: No such file or directory
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/Brian/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
--with-pg
--without-pg
--with-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}/
Run Code Online (Sandbox Code Playgroud)
我很感激您提供的任何帮助.谢谢!
Tom*_*Leu 254
你可能有错误的路径--with-pg-config
,检查它是否真的存在.
您可以找到正确的路径pg_config
:
find /Applications -name pg_config
Run Code Online (Sandbox Code Playgroud)
在最新的Postgres.app版本中,路径是:
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config
Run Code Online (Sandbox Code Playgroud)
Mar*_*tuc 16
在我的情况下(运行Postgres.app v9.3.4.2)它似乎只在前置环境架构标志时工作:
env ARCHFLAGS="-arch x86_64" gem install pg -- \
--with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
Run Code Online (Sandbox Code Playgroud)
Lou*_*ers 13
在一个全新的Mac上,这就是我必须做的事情:
现在运行(希望是一个面向未来的命令):
version=$(ls /Applications/Postgres.app/Contents/Versions/ | tail -1)
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/$version/bin/pg_config .
如果遇到问题,可以通过查看mkmf.log中的实际错误来解决问题,你可以通过运行找到它(如果使用rvm):
cd ~/.rvm ; find . -name mkmf.log | grep pg
Run Code Online (Sandbox Code Playgroud)
我能用这个命令安装pg
gem install pg -- --with-pg-config=/Library/PostgreSQL/9.3/bin/pg_config
Run Code Online (Sandbox Code Playgroud)
我跑步找到了自己的道路
sudo find / -name "pg_config"
Run Code Online (Sandbox Code Playgroud)
我成功安装了pg-0.17.1
归档时间: |
|
查看次数: |
32857 次 |
最近记录: |