【问题标题】:Error installing PostgreSQL on Mac OS X 10.5 using MacPorts使用 MacPorts 在 Mac OS X 10.5 上安装 PostgreSQL 时出错
【发布时间】:2023-03-11 03:05:01
【问题描述】:

我已经在几台不同的计算机上使用 MacPorts 安装了 PostgreSQL,没问题,但是当涉及到我自己的笔记本电脑时,我无法构建它。

当我执行这个命令时:

sudo port install postgresql83

我收到此错误:

checking test program... failed
configure: error:
Could not execute a simple test program.  This may be a problem
related to locating shared libraries.  Check the file 'config.log'
for the exact reason.

Error: The following dependencies failed to build: postgresql83
Error: Status 1 encountered during processing.

config.log 文件有 7000 行长,我看不到明显的问题(不过,它在最后一行显示“exit 1”!)。

我确实有开发者工具,但没有安装,我已经更新到最新版本的 MacPorts 并同步了我的端口树。我可以通过 MacPorts 安装其他东西。

我在 Google 上搜索了有关这意味着什么的详细信息,但徒劳无功。有什么建议?谢谢!

更新:我认为这是导致它失败的原因(来自 config.log):

configure:8307: ./conftest
dyld: Library not loaded: /opt/local/lib/libxml2.2
  Referenced from: /opt/local/lib/libxslt.1.dylib
  Reason: image not found

我安装了 libxml2,但它可能搞砸了。我卸载了 libxml2 和 libxslt 并重新安装它们,所以我们会看看会发生什么。

【问题讨论】:

  • 你能把config.log的最后几行贴出来吗?该文件往往非常冗长,但其中某处实际上失败了的命令...

标签: macos postgresql macports


【解决方案1】:

这是关键:

configure:8307: ./conftest
dyld: Library not loaded: /opt/local/lib/libxml2.2
  Referenced from: /opt/local/lib/libxslt.1.dylib
  Reason: image not found

这不在 config.log 的底部附近,大约在第 700 行。

尽管我已经将 libxml 升级到了适当的版本(这是我之前在安装 postgresql 时必须解决的一个问题),但它不能与 libxslt 一起使用。

我卸载了libxml(我已经安装了两个版本)和libxslt,然后再次安装了postgresql,这次它能够构建了。

如果您在构建 postgresql 时遇到这样的错误,请查看库。

顺便说一句,config.log 文件可以在这样的位置找到:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_postgresql83/work/postgresql-8.3.6/config.log

【讨论】:

【解决方案2】:

postgresql83 在 MacPorts 中的版本为 8.3.6。与您的副本正在使用的版本相同吗? “port info postgresql83” 如果它们不同,请执行“sudo port selfupdate && sudo port upgrade -u outdated && sudo port clean postgresql83”以更新所有内容,然后重试。

据我所知,postgresql83 应该依赖于 libxml2,而不是 libxml。这应该已经由 MacPorts 处理了。您可能希望以任何一种方式执行上述命令(确保更新依赖项并清理目录以重试)。

【讨论】:

  • 你说得对,它确实依赖于 libxml2。当我称它为 libxml 时,我并不准确。我安装了以前的版本。我已将其停用以安装最新版本,但显然这不起作用。卸载它并重新安装。
  • 'upgrade -u' 中的 -u 将在升级期间删除旧版本(所有非活动版本)。这是否意味着你已经成功了?
  • 啊,酷,我不知道升级-u。不过,我确实让 Postgres 工作了。
【解决方案3】:

我意识到这是一个不能解决问题的答案,但是作为一个不喜欢 mac 端口的 mac 用户,我找到了另一种安装 postgres 的解决方案。不久前,postgres 网站downloads section 开始推广EnterpriseDB's one-click installer

我过去曾尝试通过 mac 端口安装它,最终决定从源手动安装它,这很痛苦。这个安装程序很不错。它将可执行文件放在适合 mac 的位置,将其库放在 /Library 中,甚至包括一些额外的程序来帮助使用 postgres。试一试,当有高质量的安装程序可用时,无需安装易碎的 mac 端口。

【讨论】:

    猜你喜欢
    • 2010-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-15
    • 1970-01-01
    • 2010-10-12
    • 2016-10-08
    相关资源
    最近更新 更多