gpt4 book ai didi

ruby-on-rails-3 - Gem Install PG 神秘报错extconf.rb相关

转载 作者:行者123 更新时间:2023-11-29 11:39:17 25 4
gpt4 key购买 nike

我正在尝试更新我的 pg gem,但出现以下错误

Building native extensions.  This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.

/Users/larson/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config
Using config values from /Library/PostgreSQL/9.1/bin/pg_config
checking for libpq-fe.h... *** 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/larson/.rvm/rubies/ruby-1.9.2-p290/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
/Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
from extconf.rb:40:in `<main>'


Gem files will remain installed in /Users/larson/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.13.2 for inspection.
Results logged to /Users/larson/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.13.2/ext/gem_make.out

我尝试搜索 mkmf.log 文件,但找不到。我尝试了几种方法,包括放置 pg_conf 文件的目录,但到目前为止没有任何效果。我在 10.6.8 上尝试这个。雪豹和我的 ruby 是 1.9.2-p290。我已经安装了 pg 9.1。

我试过这个:

gem 安装 pg

gem install pg -- --with-pg-config=/usr/local/bin/pg_config

这个问题出现在我更换我的macbook pro硬盘并通过时间机器恢复系统后。我应该重新安装 XCode 吗?还有其他建议吗?

最佳答案

我遇到了类似的问题。我通过更新 rvm 绕过了它:

rvm get latest
rvm reload
rvm --force install 1.9.2

关于ruby-on-rails-3 - Gem Install PG 神秘报错extconf.rb相关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9593366/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com