使用时间机器备份将文件从运行 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)
rvm get head
试图用 macports 在本地安装 postgre 时头撞墙。卸载 macports 并安装 homebrew
关注的记录来自
brew doctor
然后
冲泡安装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