【发布时间】:2012-07-23 18:05:26
【问题描述】:
使用时间机器备份将文件从运行 Leopard 的 macbook 同步到运行 Lion 的 macbook pro。由于我正在运行 sqlite3,在推送到 heroku 时遇到了麻烦,我在尝试安装 pg gem 时陷入了困境。
gem install pg
产量:
/Users/taylorjackson/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/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.
我是 Unix 菜鸟,我担心时间机器在将 32 位豹与 64 位狮子混搭时创建的文件结构存在严重问题。到目前为止我已经采取的步骤。
重新安装 XCode
Xcode 4.3.3
Build version 4E3002
在 XCode 中从首选项安装命令行工具。
更新到 rvm 1.14.6 (master) with
rvm get head
试图用 macports 在本地安装 postgre 时头撞墙。卸载 macports 并安装 homebrew
来自
的关注记录brew doctor
然后
brew 安装 postgresql
遇到 python 问题并按照建议安装 w/o python
brew install --no-python postgresql
似乎获得了 postgresql 的全新安装,但我的输出来自
gem install pg
还是:
/Users/taylorjackson/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/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.
也试过
bundle install
和
bundle config build.pg --with-pg-config=/users/taylorjackson/postgresql/bin/pg_config
bundle install
结果相同 我过去 7 小时的工作效率已降至零。找不到相关的 mkmf.log 文件。还有其他想法吗?
编辑:
找到 mkmf.log。以下是相关内容:
def have_devel?
unless defined? $have_devel
$have_devel = true
$have_devel = try_link(MAIN_DOES_NOTHING)
end
$have_devel
end
def try_do(src, command, &b)
unless have_devel?
raise <<MSG
The complier failed to generate an executable file.
You have to install development tools first.
MSG
end
begin
src = create_tmpsrc(src, &b)
xsystem(command)
ensure
log_src(src)
rm_rf 'conftest.dSYM'
end
end
【问题讨论】:
-
在搜索“gem install Lion”时有很多几乎相同的问题。您在发布之前是否进行了搜索,如果是,那么现有答案没有帮助怎么办?
-
我花了将近 4 个小时逐步浏览相关线程,(因此我的初始帖子很长,主要来自 SE 建议)。似乎有很多相关的奇怪的文件结构意外事件 - 所有机器依赖。就我而言,不知何故,我的 postgresql 安装位置创建了一个新的本地用户(尽管我没有更改任何默认位置 - 安装到 /usr /root 可能??),并引导 gem install 在错误的地方。重置和删除用户(+原始帖子中提到的所有其他内容)让事情变得简单。
-
啊,谢谢。我只问'因为我最近在 OSX lion 上看到了关于 ruby 的 pg jem 的 v.similar 帖子的真正激增。如果您链接到相关帖子会有所帮助,尤其是因为它会帮助其他迟到发现您的问题的人。r
标签: ruby-on-rails macos postgresql osx-lion pg